using INFORMATION_SCHEMA

Verify this for other versions of SQL