March 29, 2011 at 9:30 am
Is there a way to run a system function or look at a dmv which will display information about columns in a table? What system functions or system catalogs will show the best information on columns in a table?
I am looking to run a query which shows the number of columns in a specific table in a database.
March 29, 2011 at 9:42 am
I would recommend you take a look at some of the information_schema views. Specifically:
select * from information_schema.tables
select * from information_schema.columns
March 29, 2011 at 9:43 am
also exec sp_help [tablename] provides a lot of nice information, when you need one specific table's info.
Lowell
March 29, 2011 at 9:56 am
Awesome. Thanks for they quick reply!:-D
March 29, 2011 at 9:56 am
Lowell (3/29/2011)
also exec sp_help [tablename] provides a lot of nice information, when you need one specific table's info.
nivek-224024 (3/29/2011)
I would recommend you take a look at some of the information_schema views. Specifically:
select * from information_schema.tables
select * from information_schema.columns
I like it! Appreciate the assistance. Both are useful.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply