sql server中查找特定类别的列的写法
程序员文章站
2023-11-26 19:59:16
复制代码 代码如下:select a.name, o.name as tablename, o.type, a.id, o.object_id, o.schema_id&n...
复制代码 代码如下:
select a.name, o.name as tablename, o.type, a.id, o.object_id, o.schema_id
from sys.syscolumns as a inner join sys.systypes as b on a.xtype = b.xtype
and b.name = 'nvarchar'
inner join
sys.objects as o on a.id = o.object_id
where (o.type = 'u')
and (o.schema_id = 1)