You can obtain this information and much, much more by querying the [Information Schema views][1].
This sample query:
SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = N'Customers'
Can be made over all these DB objects:
- [CHECK_CONSTRAINTS][2]
- [COLUMN_DOMAIN_USAGE][3]
- [COLUMN_PRIVILEGES][4]
- [COLUMNS][5]
- [CONSTRAINT_COLUMN_USAGE][6]
- [CONSTRAINT_TABLE_USAGE][7]
- [DOMAIN_CONSTRAINTS][8]
- [DOMAINS][9]
- [KEY_COLUMN_USAGE][10]
- [PARAMETERS][11]
- [REFERENTIAL_CONSTRAINTS][12]
- [ROUTINES][13]
- [ROUTINE_COLUMNS][14]
- [SCHEMATA][15]
- [TABLE_CONSTRAINTS][16]
- [TABLE_PRIVILEGES][17]
- [TABLES][18]
- [VIEW_COLUMN_USAGE][19]
- [VIEW_TABLE_USAGE][20]
- [VIEWS][21]
[1]:
[To see links please register here]
[2]:
[To see links please register here]
[3]:
[To see links please register here]
[4]:
[To see links please register here]
[5]:
[To see links please register here]
[6]:
[To see links please register here]
[7]:
[To see links please register here]
[8]:
[To see links please register here]
[9]:
[To see links please register here]
[10]:
[To see links please register here]
[11]:
[To see links please register here]
[12]:
[To see links please register here]
[13]:
[To see links please register here]
[14]:
[To see links please register here]
[15]:
[To see links please register here]
[16]:
[To see links please register here]
[17]:
[To see links please register here]
[18]:
[To see links please register here]
[19]:
[To see links please register here]
[20]:
[To see links please register here]
[21]:
[To see links please register here]