Unix Technical Forum

Query to compare table data between Test and Production?

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


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 08:43 AM
Jeffrey Sheldon via SQLMonster.com
 
Posts: n/a
Default 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.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 08:43 AM
Stu
 
Posts: n/a
Default Re: Query to compare table data between Test and Production?

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-29-2008, 08:45 AM
Jeffrey Sheldon via SQLMonster.com
 
Posts: n/a
Default Re: Query to compare table data between Test and Production?

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:31 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com