我想查询某一字段值在数据库中的哪些表中出现过了,如何写sql语句?

日期:2012-09-03 13:31:45 人气:1

我想查询某一字段值在数据库中的哪些表中出现过了,如何写sql语句?

如果是SQL Server,可对需要检查的数据库,执行下述脚本:(例子内是查brand自动在哪些表存) Select a.name as Columns, b.name as TableName from syscolumns a left join sysobjects b on a.id = b.id Where b.type = 'U' and a.name ='brand' order by b.name b.type = 'U'查的
    A+
热门评论