获取数据库中的表, 首先选中要获取的数据库, 然后执行命令:
select * from MSLFinanceData.INFORMATION_SCHEMA.TABLES where TABLE_TYPE='Base Table'
获取数据库中的表以及每个表的列名
Select dbo.sysobjects.name as Table_name, dbo.syscolumns.name AS Column_name FROM dbo.syscolumns INNER JOIN dbo.sysobjects ON dbo.syscolumns.id = dbo.sysobjects.id Where (dbo.sysobjects.xtype = 'u') AND (NOT (dbo.sysobjects.name LIKE 'dtproperties'))