Retrieving Information about the Tables in a Database

To provide your user with a list of options your application will probably need to get information about the tables in your database. There are several ways to get that information. The most important method is to use the INFORMATION_SCHEMA schema. This schema is standard in every database.


INFORMATION_SCHEMA is a special schema contained in every database. It contains the definition for several objects inside the database.

INFORMATION_SCHEMA conforms to an ANSI standard that provides for retrieving information from any ANSI-compatible database engine. In the case of SQL Server, INFORMATION_SCHEMA consists of a set of views that query the database’s sys* tables, ...

Get Microsoft® SQL Server™ 2005: Applied Techniques Step by Step now with O’Reilly online learning.

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