执行语句
SELECT 'SELECT * FROM '+Name+'..SysObjects Where XType=''U'' and name=''tab_scartrim'' ORDER BY Name' FROM Master..SysDatabases ORDER BY Name
生成如下语句
SELECT * FROM ********************..SysObjects Where XType='U' and name='tab_scartrim' ORDER BY Name
SELECT * FROM ********************..SysObjects Where XType='U' and name='tab_scartrim' ORDER BY Name
SELECT * FROM ********************..SysObjects Where XType='U' and name='tab_scartrim' ORDER BY Name
进行二次查询就能知道什么数据库存在表了