How to compare two databases

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dougancil
    Contributor
    • Apr 2010
    • 347

    How to compare two databases

    I have the following query that I run nightly:

    Code:
    SET QUOTED_IDENTIFIER ON 
    GO
    SET ANSI_NULLS ON 
    GO
    
    ALTER  PROCEDURE YourProcedure AS
    
    insert into msbtotal.dbo.newclients
    SELECT tcms_members.dbo.memberdata.* FROM tcms_members.dbo.memberdata left outer join 
    msbtotal.dbo.memberdata on tcms_members.dbo.memberdata.id = 
    msbtotal.dbo.memberdata.id where msbtotal.dbo.memberdata.id is
    null
    GO
    SET QUOTED_IDENTIFIER OFF 
    GO
    SET ANSI_NULLS ON 
    GO
    and what this is supposed to do is to compare msbtotal.dbo.me mberdata and tcms_members.db o.memberdata and then insert any new data into msbtotal.dbo.ne wclients. I'm not getting any errors when I run this but I've added data to the table and it's not updating correctly. Can anyone advise as to why this isnt working correctly.

    Thanks

    Doug
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Hi Doug, I thought you solved this on your earlier post? Is there a new problem?

    ~~ CK

    Comment

    • dougancil
      Contributor
      • Apr 2010
      • 347

      #3
      CK,
      I discovered that it wasn't the query, it was the job in DTS on the server that wasn't working. I've corrected the problem.

      Thank you for responding though.

      Doug

      Comment

      Working...