ANSI SQL Schema Views

SQL Server provides a number of views for accessing the system catalogs. These objects provide an ANSI SQL-92 compliant means of retrieving meta- data and system-level information from the server. You should use these rather than querying system catalog tables for two reasons:

  1. You can depend on them not to change across releases of SQL Server, even though their underlying system tables may change.

  2. The ANSI SQL-92 specification defines these views, so they should work similarly between different DBMS platforms.

The SQL-92-compliant views that SQL Server provides are as follows:

  • CHECK_CONSTRAINTS

  • COLUMN_DOMAIN_USAGE

  • COLUMN_PRIVILEGES

  • COLUMNS

  • CONSTRAINT_COLUMN_USAGE

  • CONSTRAINT_TABLE_USAGE

  • DOMAIN_CONSTRAINTS

  • DOMAINS

  • KEY_COLUMN_USAGE ...

Get Guru's Guide to SQL Server™ Stored Procedures, XML, and HTML, The now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.