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 |
|
learn2do
Starting Member
2 Posts |
Posted - 2011-10-16 : 18:55:25
|
| I have two similar tables(a,b) with 40 (same) columns. I want to compare data of each column in a with respective column in table b and report only the columns that are mismatching. Does anybody has a procedure/query to achieve this?Thanks |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
jassi.singh
Posting Yak Master
122 Posts |
Posted - 2011-10-17 : 01:31:01
|
| Hi,Refer:http://www.dba-oracle.com/t_convert_set_to_join_sql_parameter.htmhttp://www.sql-server-tool.com/compare-two-tables.htmhttp://msdn.microsoft.com/en-us/library/ms188055.aspxYou can use union all or except or merge but depending on needunion all: will give you is there any differenceexcept: will show you the column which differmerge: can act on difference i.e. update,delete,insert statementsPlease mark answer as accepted if it helped you.Thanks,Jassi Singh |
 |
|
|
learn2do
Starting Member
2 Posts |
Posted - 2011-10-17 : 08:21:19
|
| Hi,I don't wanna see matching columns in the output.How do I hide them ? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-17 : 08:29:16
|
| if you use jeffs suggestion you will get only unmatched columnlist------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|