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

using the command line to script a database

using the command line to script a database:-

sqldatacompare /db1:WidgetStaging /db2:WidgetProduction
/ScriptFile: "C:\Scripts Folder\WidgetSyncScript.sql"

how do i specify the server where the database is, i.e. somthing like this?

sqldatacompare /db1:SERVERNAME\WidgetStaging /db2:SERVERNAME\WidgetProduction
/ScriptFile: "C:\Scripts Folder\WidgetSyncScript.sql"
gsuttie
0

Comments

4 comments

  • Michelle T
    The switches you're looking for are /server1: and /server2: (or /s1: and /s2:). So your command line would look like the following:

    sqldatacompare /server1:SERVERNAME /db1:WidgetStaging /server2:SERVERNAME /db2:WidgetProduction /ScriptFile:"C:\Scripts Folder\WidgetSyncScript.sql"
    Michelle T
    0
  • digi-dave
    cheers for that... even simpler for setting up a static project, you can use an existing project definition (saves server,db and unames and pwds and everything else) ie...

    sqldatacompare /project:"C:\Documents and Settings\user\My Documents\SQL Data Compare\SharedProjects\LocalServercRemoteServer.sdc" /ScriptFile:"C:\Data\scripts\OutputSql.sql"
    digi-dave
    0
  • gsuttie
    Im trying the following from a batch file:-

    cd "c:\program files\Red gate\SQL Data Compare 8"

    sqldatacompare.exe /server1:INVERNESS\SQL2005 /db1:GREGSTEST_DEV /scr2:"C:\Documents and Settings\gsuttie\Desktop\SQL continuos\ScriptsFolder\GREGSTESTSCRIPTS"

    /synchronize

    pause

    I have also tried /sync both erroring - where am i going wrong?

    Thanks
    Gregor
    gsuttie
    0
  • RogerHart
    Hi

    Your syntax there looks fine to me - what is the error message you get when this fails?
    RogerHart
    0

Add comment

Please sign in to leave a comment.