How can I get the name of all columns of a table in SQL SERVER 2008?

SELECT *
FROM Databasename.INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = N’table name

Can be made over all these DB objects:
– CHECK_CONSTRAINTS
– COLUMN_DOMAIN_USAGE – COLUMN_PRIVILEGES
– COLUMNS
– CONSTRAINT_COLUMN_USAGE
– CONSTRAINT_TABLE_USAGE
– DOMAIN_CONSTRAINTS
– DOMAINS
– KEY_COLUMN_USAGE
– PARAMETERS
– REFERENTIAL_CONSTRAINTS
– ROUTINES
– ROUTINE_COLUMNS
– SCHEMATA
– TABLE_CONSTRAINTS
– TABLE_PRIVILEGES
– TABLES
– VIEW_COLUMN_USAGE
– VIEW_TABLE_USAGE
– VIEWS

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s