A Primer on INFORMATION_SCHEMA Views in SQL Server 2000
(Page 1 of 5 )
This article mainly concentrates on using INFORMATION_SCHEMA views effectively in Microsoft SQL Server 2000, to retrieve the meta-information of a database.
Introduction
The word meta-data has several meanings and definitions. Meta-data describes the structure and meaning of data. In short, it explains the structure (or definitions) of existing data. It can also be defined as “data about data.”
From the Microsoft SQL Server 2000 point of view, meta-data is something about exploring the structures (or definitions) of entire database schema, including each and every object (tables, views, and so forth) present within that schema. Meta-data would include, for example, a list of tables, a list of the parameters of a particular stored procedure, a list of all user-defined functions, and so on.
Microsoft® SQL Server™ 2000 provides two methods for obtaining meta-data: system stored procedures and information schema views. System stored procedures will be generally (or heavily) used by DBAs to get any information about an SQL Server database. But, it would be quite hard to remember all of the internal stored procedures and their hierarchies. Another issue is that the system stored procedures tend to change from every version of SQL Server. Lots of differences (or enhancements) in system stored procedures exist from SQL Server 6.5 to 7.0 and even to 2000 (and of course to 2005) as well.
The better, the best and the simple way to get this type of information (meta-information about database) is to use INFORMATION_SCHEMA views. These views provide an internal, system table-independent view of the SQL Server meta-data. Information schema views allow applications to work properly, even though significant changes have been made to the system tables. These are most recommended for application programmers when they would like to play with database system information. The information schema views included in SQL Server conform to the SQL-92 Standard definition for the INFORMATION_SCHEMA.
These views are defined in a special schema named INFORMATION_SCHEMA, which is contained in each database. Each INFORMATION_SCHEMA view contains meta-data for all of the data objects stored in that particular database.
Next: High-level overview of all INFORMATION_SCHEMA views >>
More MS SQL Server Articles
More By Jagadish Chaterjee