APD Toronto
asked on
Script to read table Def
Hi Experts
Does any one know how to do a script (or has one) that will loop through every field of a given table and retrieve its field name, type and size?
by size, i mean:
- if type text, size = 15
- if type = number, size = long
- if type = yes/no, size = true/false
etc...
Ideally, i'd store this info in a 4-field table (table, name, type, size), and use in a report to print and document.,
Any help will be appreciated
Does any one know how to do a script (or has one) that will loop through every field of a given table and retrieve its field name, type and size?
by size, i mean:
- if type text, size = 15
- if type = number, size = long
- if type = yes/no, size = true/false
etc...
Ideally, i'd store this info in a 4-field table (table, name, type, size), and use in a report to print and document.,
Any help will be appreciated
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You appear to be duplicating what is already available in the database documentor tool
ASKER
alkimark, where can I get what the type #s are?
open up your immediate window and type
When you type the period, you should see, courtesy of intellisense, a list of the enum names and values for database field type.
?DataTypeEnum.
When you type the period, you should see, courtesy of intellisense, a list of the enum names and values for database field type.
For a somewhat more elegant report on fields, see my Extras Plus add-in (http://www.helenfeddema.com/Files/code20.zip), a free download from my Website. One of its menu add-ins creates a nicely formatted report listing all fields in all tables in the current database, either alphabetically or by order in the table:
Table-Fields-Report.jpg
Table-Fields-Report.jpg