SQL Server根据字段得到表名

select objs.name as TableName, cols.name as ColName 
From sysobjects objs inner join syscolumns cols on (objs.id=cols.id)
where objs.xtype='U' and cols.name='字段名'
发布了62 篇原创文章 · 获赞 28 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/native_lee/article/details/102819098