sql server中查找特定类别的列的写法
程序员文章站
2023-12-12 08:36:40
复制代码 代码如下: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)