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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying table column name and description only 2

Status
Not open for further replies.

Asif22

Programmer
Oct 15, 2001
1
0
0
GB
Having used oracle/informix/mysql where u can just describe the table ie. desc <tablename> to get a summary of just the
table columns; How do I do this using T-SQL ?
It get's a bit troublesome having to go into Enterprise Manager to display graphically the descriptions.

I'm trying to utilise isql to just display column description of a tablename.

Thanks in advance for any help.

 
Try this:

SELECT c.name
FROM syscolumns c
INNER JOIN sysobjects o
ON c.id = o.id
WHERE o.name = 'tbl_tablename'

Chip H.
 

Try sp_help.

exec sp_help 'dbo.tablename' Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Thanks Terry. I came from an Oracle environment, and I've been amazed at the lack of &quot;helper&quot; views and procs in MS SQL Server. I guess I need to be more creative in searching the BOL.

Chip H.
 
sp_help is the best.

Micorsoft does not recommend referenceing the sys tables. Instead use any of the INFORMATION_SCHEMA views for this purpse.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top