Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get object and structure info for a table

Status
Not open for further replies.

cshncn

Programmer
Jan 14, 2003
11
US
Hi,

I wonder if I can use a query to list object information for a table, such as name and datatype of columns, constraints, etc. I know this is a simple question but I just couldn't get it by myself. I have searched Books Online but not successful. Thanks!

cshncn
 
Depending on exactly what information you want, there are a variety of ways to get there. You can use sp_help tablename to get information on a table, but the results can't easily be captured in a table for manipulation. SQL2K includes Information_Schema views that provide information on database objects. Also check out functions, meta data in BOL for a list of functions that provide specific information on database objects. Good luck!

--Angel [rainbow]
-----------------------------------
Every time I lose my mind, I wonder
if it's really worth finding.
 
In Query Analyzer (SQL2000) you can right click the table and select a create statment. That will show you the fields, types ect.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top