--补充完整吧,看楼主能否用得上,以下是SQL SERVER中的实现 select a.name from (select name from test1..sysobjects where xtype ='U') a left join (select name from test2..sysobjects where xtype ='U') b on a.name = b.name where b.name is null
select table_name from information_schema.tables where table_schema in ('A','B') group by table_name having count(1) > 1;
。因为这些表和SP,还有视图都有一千多个啊。一个去找很费时间的。
现在想通过SQL语句来查找,是少了哪几个表。主要的意思是这些!不知道,我说的是不是很明白!
再次感谢WWWWA
INTERSECT
SELECT * FROM b
不知道有测试过没?
直接用sysobjects表就行了。给你个提示,select * from dbname.dbo.sysobjects where xtype='U'然后就简单了,直接两个sysobjects做left join, is null 就行了。.
[align=center]==== 思想重于技巧 ====
[/align]
.
贴子分数<20:对自已的问题不予重视。
贴子大量未结:对别人的回答不予尊重。
.
select a.name from
(select name from test1..sysobjects where xtype ='U') a
left join (select name from test2..sysobjects where xtype ='U') b on a.name = b.name
where b.name is null