Wednesday Mar 14th 2007 by DatabaseJournal.com Staff

Tutorial: How to extract meta information from SQL Server using the INFORMATION_SCHEMA views, the system catalogs and/or the system stored procedures. This article contains the SQL queries to list the tables, views, fields, constraints, functions, triggers, stored procedures and the other elements from a database.

[From Lorenzo Alberton]

Following my tutorials on how to extract meta informations from Firebird SQL and from PostgreSQL, I'm now going to show how to retrieve the same informations from Microsoft SQL Server, using the INFORMATION_SCHEMA, with system tables (sysobjects, sysindexkeys, sysindexes, syscolumns, systypes, etc) and/or with system stored procedures (T-SQL). SQL Server 2005 introduced some catalog views called "sys.*": for completeness, I may use them too in the queries. To list all the views available in the INFORMATION_SCHEMA, you can run the following query from the 'master' database...

The article continues at http://www.alberton.info/sql_server_meta_info.html

Mobile Site | Full Site
Copyright 2017 © QuinStreet Inc. All Rights Reserved