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.

Using INFORMATION_SCHEMA

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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.