Friday, September 17, 2010

Get column names of a specified table in SQL

//Post By Suresh Chand

SELECT [NAME] AS 'Columns' FROM SYSCOLUMNS WHERE [ID] = Object_Id('Table Name')

OR

exec sp_columns 'Table Name'

No comments:

Post a Comment