Tuesday, April 22, 2008

How to retrieve a list of column names for a specific table in MS SQL Server.

One way:

sp_columns 'table name'

Another way:

SELECT * FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'MyTable'

0 comments: