This is a discussion on Query to compare table data between Test and Production? within the SQL Server forums, part of the Microsoft SQL Server category; --> I am debugging one of our programs and ran the fix in Test. I would like to compare table ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I am debugging one of our programs and ran the fix in Test. I would like to compare table 1 between Production and Test. I want the query to output column 1 if Production <> Test output. What is the best way to achieve this? jeff -- Message posted via http://www.sqlmonster.com |
| |||
| How many columns did your fix affect? If it's just one, and it's not your primary key (or unique identifier), then you could simply do something like: SELECT col1 FROM Production.dbo.Table 1 t1 JOIN Test.dbo.Table t2 ON t1.col1=t2.col1 WHERE t1.AffectedColumn <> t2.AffectedColumn If that ain't it, can you post more so we can narrow it down a bit? Stu |
| ||||
| Stu, No thanks that will do it...I just had a lapse in memory on how to achieve this. Jeff -- Message posted via http://www.sqlmonster.com |