sql server全库字段查询

有时忘记某个字段在数据库中的哪个表里了,可以利用syscolumns来进行查找。

select object_name(id) objName,Name as colNamefrom syscolumnswhere (name like'%模糊被查找字段%')and id in(select id from sysobjects where xtype='u')order by objname;

留下评论