日期:2014-05-17 浏览次数:20517 次
lz执行一下 SELECT OBJECT_NAME(object_id) AS tablename,name,column_id FROM SYS.columns ORDER BY tablename,column_id
------解决方案--------------------
--获取表名 SELECT name FROM sys.sysobjects WHERE TYPE='U' SELECT name FROM sys.tables WHERE TYPE='U' SELECT name FROM sys.objects WHERE TYPE='U' --获取表名,字段及类型 SELECT b.name tableName,a.name columnName,c.name typeName FROM sys.columns a inner join sys.objects b on a.object_id=b.object_id and b.TYPE='U' inner join sys.types c on a.user_type_id=c.user_type_id --and c.name='bit' -- 字段类型 order by a.object_id,column_id