Friday, March 9, 2012

Query to compare table data between Test and Production?

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.comHow 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

No comments:

Post a Comment