-- USE YOUR DB NAME select QUOTENAME(SCHEMA_NAME(SCHEMA_ID)) + '.' + QUOTENAME(NAME) FROM SYS.TABLES select '[' + schema_name(schema_id) + '].[' + name + ']' from sys.tables SELECT '[' + TABLE_SCHEMA + '].[' + TABLE_NAME + ']' FROM INFORMATION_SCHEMA.TABLES select quotename(User_Name(uid))+'.'+ quotename(Object_Name(id)) as [Schema Table] from sysObjects where xtype = 'U'
4种方式都可以。
执行结果:
参考来源:http://blog.sqlauthority.com/2009/06/17/sql-server-list-schema-name-and-table-name-for-database/#comment-53071
(结束)