March 3, 2009 at 8:51 am
I need to create a booklet of some of our 84000 tables in MS Sql I would like to be able to use t-sql to get table definitions I need?
March 3, 2009 at 8:58 am
Pretty broad request, what are you actually try to get back from the sql query?
March 3, 2009 at 9:00 am
Column Name, field type, length
March 3, 2009 at 9:02 am
Let me point you toward Books Online (BOL). Take a look at the definitions of sys.tables, sys.columns, sys.types.
March 3, 2009 at 10:27 am
I USED THIS SELECT AND IT HAD ALL THE INFORMATION I NEEDED
SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'YOUR_TABLE_NAME' ORDER BY COLUMN_NAME
THANKS
March 3, 2009 at 2:00 pm
twdavis (3/3/2009)
I USED THIS SELECT AND IT HAD ALL THE INFORMATION I NEEDEDSELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'YOUR_TABLE_NAME' ORDER BY COLUMN_NAME
THANKS
keep in mind that information_schema "hides" the tables you don't have permissions on... ( 😉 )
* Noel
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply