Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mavershang
Posting Yak Master
111 Posts |
Posted - 2008-12-02 : 17:02:24
|
| Hi guys,Here is my question.I have 2 tables (maybe just temporary tables). I want to check whether they are different and return the number of the different columns.Is there any way to do this?Thanks. |
|
|
hanbingl
Aged Yak Warrior
652 Posts |
Posted - 2008-12-02 : 17:19:24
|
| please illustrate it... |
 |
|
|
mavershang
Posting Yak Master
111 Posts |
Posted - 2008-12-02 : 17:27:22
|
The 2 tables contain the same columns. I just want to see whether the 2 tables are different. and if there is any difference, return the number of the different rows.for example:table A:col1 col2 col31 1 12 2 2....table B:col1 col2 col31 1 13 3 3......quote: Originally posted by hanbingl please illustrate it...
|
 |
|
|
hanbingl
Aged Yak Warrior
652 Posts |
Posted - 2008-12-02 : 17:35:24
|
| [code]select count(*) from (select * from AEXCEPTselect * from B)t[/code] |
 |
|
|
mavershang
Posting Yak Master
111 Posts |
Posted - 2008-12-02 : 17:47:25
|
Thanks a lot. it is very helpfulquote: Originally posted by hanbingl
select count(*) from (select * from AEXCEPTselect * from B)t
|
 |
|
|
|
|
|