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 |
Ismee
Starting Member
2 Posts |
Posted - 2012-12-06 : 10:09:17
|
1. Table A colum Z2. Table H column Y from anothe dbData from 1. will be inserted into 2.I need to check if all data from 1. are inserted into 2. Successfully.Not only verify the records.but the data. Like data has abcd1234 then it should also inserted into 2. exactlySorry that I am rookie in SQL query. Can it be done via query and return true/ false result? And pointing which data is not inserted if false? |
|
shilpash
Posting Yak Master
103 Posts |
Posted - 2012-12-06 : 10:16:36
|
select COLUMNZ FROM TABLEAEXCEPT SELECT COLUMNY FROM TABLEHIF YOU SEE 0 RECORDS,IT MEANS ALL DATAS ARE SAME,,IF ANY ROWS, THEN DATA FOR THAT ROW IS DIFFERENT. |
|
|
Ismee
Starting Member
2 Posts |
Posted - 2012-12-06 : 19:47:15
|
Thanks. How do I compare when the table is located at different db?Can I use multiple except to compare more than 2 table? |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2012-12-06 : 21:00:16
|
[code]select COLUMNZ FROM DBNAME.dbo.TABLEAEXCEPT SELECT COLUMNY FROM DBNAME.dbo.TABLEH[/code] |
|
|
|
|
|