Friday, March 20, 2015

How to find information about tables, columns, data types, nullable etc.


SELECT 
    t.TABLE_CATALOG
    ,t.TABLE_SCHEMA
    ,t.TABLE_NAME
    ,t.COLUMN_NAME
    ,t.IS_NULLABLE
    ,t.DATA_TYPE
    ,t.CHARACTER_MAXIMUM_LENGTH
FROM  INFORMATION_SCHEMA.COLUMNS t