I've known about the
INFORMATION_SCHEMA views (or system tables) in SQL Server for a while, but I just leared recently that they are actually part of the SQL-92 standard and supported on other database platforms.
INFORMATION_SCHEMA views provide meta data information about the tables, columns, and other parts of your database. Because the structure of these tables are standardized you can write SQL statements that work on various database platforms.
For example suppose you want to return a resultset with a list of all columns in a table called
SELECT table_name, column_name, is_nullable, data_type, character_maximum_length FROM INFORMATION_SCHEMA.Columns WHERE table_name = 'employees'
Quite a handy feature, but it's hard to find what versions the of various database platforms started supporting this feature, here's a quick[Read more...]