Technical Article

Get column names in a table

,

Script to get a table's columns

USE [DatabaseName]
GO
SELECT column_name 'Column Name',
data_type 'Data Type',
CHARacter_maximum_length 'Maximum Length'
FROM information_schema.columns
WHERE table_name = 'TableName'
GO

Rate

1.78 (9)

You rated this post out of 5. Change rating

Share

Share

Rate

1.78 (9)

You rated this post out of 5. Change rating