2010年12月29日 星期三

SQL Server: Query all table name with their schema

SELECT RTRIM(TABLE_SCHEMA) SchemaName, RTRIM(TABLE_NAME) TableName
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
ORDER BY TABLE_SCHEMA, TABLE_NAME

沒有留言: