O'Reilly logo

Beginning Transact-SQL with SQL Server 2000 and 2005 by Dan Wood, Paul Turley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

D

Information Schema Views Reference

The following views can be used in any database to obtain metadata about database objects. Select from each view as if it were a table in the database, prefixing the view with “INFORMATION_SCHEMA.” as in the following example:

SELECT * FROM INFORMATION_SCHEMA.CHECK_CONSTRAINTS

Information schema views are stored in the Master database. Note that the SysName(256) user-defined data type is equivalent to nVarChar(128).

CHECK_CONSTRAINTS

Column Name Data Type
CONSTRAINT_CATALOG nVarChar(256)
CONSTRAINT_SCHEMA nVarChar(256)
CONSTRAINT_NAME SysName(256)
CHECK_CLAUSE nVarChar(8000)

COLUMN_DOMAIN_USAGE

Column Name Data Type
DOMAIN_CATALOG nVarChar(256)
DOMAIN_SCHEMA nVarChar(256)
DOMAIN_NAME SysName(256)
TABLE_CATALOG nVarChar(256)
TABLE_SCHEMA nVarChar(256)
TABLE_NAME SysName(256)
COLUMN_NAME SysName(256)
DOMAIN_CATALOG nVarChar(256)

COLUMN_PRIVILEGES

Column Name Data Type
GRANTOR nVarChar(256)
GRANTEE nVarChar(256)
TABLE_CATALOG nVarChar(256)
TABLE_SCHEMA nVarChar(256)
TABLE_NAME SysName(256)
COLUMN_NAME SysName(256)
PRIVILEGE_TYPE VarChar(10)
IS_GRANTABLE VarChar(3)

COLUMNS

Column Name Data Type
TABLE_CATALOG nVarChar(256)
TABLE_SCHEMA nVarChar(256)
TABLE_NAME SysName(256)
COLUMN_NAME SysName(256)
ORDINAL_POSITION SmallInt(2)
COLUMN_DEFAULT nVarChar(8000)
IS_NULLABLE VarChar(3)
DATA_TYPE SysName(256)
CHARACTER_MAXIMUM_LENGTH Int(4)
CHARACTER_OCTET_LENGTH

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required