20 Oct 2010

Getting Schema Information from SQL Server

As an aide-memoire to myself and anyone else who cares, here is a (growing, unfinished) list of the various ways you can get schema data and metadata out of SQL Server.

1. INFORMATION_SCHEMA Views

SELECT * FROM INFORMATION_SCHEMA.TABLES

SELECT * FROM INFORMATION_SCHEMA.COLUMNS


2. sys_objects

3. sp_tables, sp_columns

No comments:

Post a Comment

Comments are very welcome but are moderated to prevent spam.

If I helped you out today, you can buy me a beer below. Cheers!