How can we help you today? How can we help you today?

To save memory, can I loop through tables to sync the data?

I'm using Data Compare to sync the production data back to the development machine. Our dev machine doesn't have quite enough drive space to accommodate a whole script of our database sync. Is there a way to loop over the tables and sync them one at a time?
seeriuss
0

Comments

2 comments

  • Brian Donahue
    Hello,

    I don't know if this will save you any space, but we sure can try! Here is a DOS command that can use sqlcmd.exe to get a list of tables, then run SQL Data Compare command-line against each table, one at a time.
    for /F %i in ('sqlcmd -S MyComp\MyInst -d database1 -h -1 -Q "SET NOCOUNT ON; SELECT name from sysobjects WHERE XTYPE='U'"') do sqldatacompare /s1:MyComp\MyInst /db1:database1 /db2:database2 /s2:MyComp\MyInst /include:table:\[%i\]
    
    In the User Interface, it's easy to select the table you want to compare using the tables and views tab.

    If you can stuff a big drive in the computer, you can also set the RGTEMP environment variable to point to the new drive.
    Brian Donahue
    0
  • seeriuss
    I have to agree. That sets a record for the best DOS command ever written! Red Gate Rocks!
    seeriuss
    0

Add comment

Please sign in to leave a comment.