Query to compare table data between Test and Production?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeffrey Sheldon via SQLMonster.com

    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
  • Stu

    #2
    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.AffectedColu mn <> t2.AffectedColu mn


    If that ain't it, can you post more so we can narrow it down a bit?

    Stu

    Comment

    • Jeffrey Sheldon via SQLMonster.com

      #3
      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

      Comment

      Working...