Share via


Information Schema Views (Transact-SQL)

An information schema view is one of several methods SQL Server provides for obtaining metadata.

Important

Some changes have been made to the information schema views that break backward compatibility. These changes are described in the topics for the specific views.

Note

Information schema views provide an internal, system table-independent view of the SQL Server metadata. Information schema views enable applications to work correctly although significant changes have been made to the underlying system tables. The information schema views included in SQL Server comply with the ISO standard definition for the INFORMATION_SCHEMA.

SQL Server supports a three-part naming convention when you refer to the current server. The ISO standard also supports a three-part naming convention. However, the names used in both naming conventions are different. The information schema views are defined in a special schema named INFORMATION_SCHEMA. This schema is contained in each database. Each information schema view contains metadata for all data objects stored in that particular database. The following table shows the relationships between the SQL Server names and the SQL standard names.

SQL Server name

Maps to this equivalent SQL standard name

Database

Catalog

Schema

Schema

Object

Object

user-defined data type (alias)

Domain

This name-mapping convention applies to the following SQL Server ISO-compatible views.

Some views contain references to different classes of data such as character data or binary data.

As shown in the following example, when you reference the information schema views, you must use a qualified name that includes the INFORMATION_SCHEMA schema name.

USE AdventureWorks;
GO

SELECT ccu.TABLE_SCHEMA, ccu.TABLE_NAME, ccu.COLUMN_NAME, cc.CONSTRAINT_SCHEMA, cc.CONSTRAINT_NAME, cc.CHECK_CLAUSE
FROM INFORMATION_SCHEMA.CHECK_CONSTRAINTS AS cc
INNER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE AS ccu
    ON cc.CONSTRAINT_NAME = ccu.CONSTRAINT_NAME;