locked
SQL Azure Data Sync from command line, Agent not available in 2008 Express RRS feed

  • Question

  • I have been using SQL 2008 Enterprise with the SQL Azure Data Sync wizard with success. Agent runs the sync job, and I have also copied the sync command and used it from the command prompt with success as well.

    My question is... is the Agent service absolutely necessary for running a sync? Can I just use task scheduler to run the command instead?

    The reason I ask is because I would like to use the data sync with SQL 2008 Express, and the Express license does not allow the enabling of the Agent service (see here: http://social.msdn.microsoft.com/forums/en-US/sqlexpress/thread/58ff4ab4-0690-479a-a9b4-7384991b7b1d/ ).

    I have run the SQL Azure Data Sync Wizard on an Express installation, and it provisions the local DB, and creates the Azure DB, does the inital sync, but fails to run the job (no Agent service). I would like to try running the sync from the command line, but I am unable to locate the command created by the wizard. I can't access the agent service to get the job command, and I can't find it anywhere else. Is there another location that the Wizard stores the command? What are the parameters of the command so I can try to make one from scratch?

    -Thanks for your help,
    Albert

    Edit: This is an example of the command text I am referring to:
    C:\Users\Administrator>"C:\Program Files (x86)\Microsoft Sync Framework\Power Pack For SQL Azure November CTP\SyncLocalSqlAzureDatabase.exe" -localServer localhost -localDb AZBLANK -SqlAzureDb AZBLANK -scope Sync_AZBLANK -SqlAzureServer f7rtdxk26z.database.windows.net  -SqlAzureUser <SNIP> -SqlAzurePassword <SNIP> -ConflictResolutionPolicy LocalServerWins
    I can almost figure out the parameters, but the password one confuses me (it doesn't match my DB password, it looks like a hash of some sort?)
    Friday, December 18, 2009 6:40 PM

Answers

  • Officially we do not support Express with this CTP, but you might be able to "hack" it together to get it working. 

    To your first question, yes you can run the sync outside of SQL Agent and it is simply a matter of taking the Command line from SQL Agent and executing it externally.  To get the command line open up SSMS | SQL Agent | Jobs and then Right click on the Job and choose Properties | Steps | Edit and then copy the command line to be run in command prompt. 

    For getting it to work with SQL Express, if you have the exact same database (meaning a database that was copied from your Enterprise db and restored into SQL Express), I suspect (without trying this myself) that you should be able to execute this command line against SQL Express.

    Ultimately we will look at making this much easier for the next release...

    Liam


    Sr. Program Manager, SQL Azure and Sync Framework - http://msdn.microsoft.com/sync/
    Friday, December 18, 2009 6:53 PM

All replies

  • Here is an example of the command line I am referring to:

    C:\Users\Administrator>"C:\Program Files (x86)\Microsoft Sync Framework\Power Pack For SQL Azure November CTP\SyncLocalSqlAzureDatabase.exe" -localServer localhost -localDb AZBLANK -SqlAzureDb AZBLANK -scope Sync_AZBLANK -SqlAzureServer f7rtdxk26z.database.windows.net  -SqlAzureUser <SNIP> -SqlAzurePassword <SNIP> -ConflictResolutionPolicy LocalServerWins
    I can almost figure out the parameters, but the -SqlAzurePassword paramater is strange, it seems to be encrypted in some way.

    -Thanks,
    Albert
    Friday, December 18, 2009 6:52 PM
  • Officially we do not support Express with this CTP, but you might be able to "hack" it together to get it working. 

    To your first question, yes you can run the sync outside of SQL Agent and it is simply a matter of taking the Command line from SQL Agent and executing it externally.  To get the command line open up SSMS | SQL Agent | Jobs and then Right click on the Job and choose Properties | Steps | Edit and then copy the command line to be run in command prompt. 

    For getting it to work with SQL Express, if you have the exact same database (meaning a database that was copied from your Enterprise db and restored into SQL Express), I suspect (without trying this myself) that you should be able to execute this command line against SQL Express.

    Ultimately we will look at making this much easier for the next release...

    Liam


    Sr. Program Manager, SQL Azure and Sync Framework - http://msdn.microsoft.com/sync/
    Friday, December 18, 2009 6:53 PM
  • Liam

    Is there any update on official support for SQL Express in Albert's scenario?  If SQL Azure Datasync is not the best tool for synching between SQL Azure and SQL Express on-site, what do you suggest?

     

    Thanks
    Mark

    Monday, June 27, 2011 10:17 PM
  • the latest CTP of  Sql Data Sync (CTP2) now runs the Sync Agent  as a Windows Service instead of running inside Sql Agent.

    you may also do the sync via Sync Framework 2.1 itself, see the following:

    How to: Configure and Execute Synchronization with SQL Azure

    http://blogs.msdn.com/b/sync/archive/2010/08/31/sql-server-to-sql-azure-synchronization-using-sync-framework-2-1.aspx

    http://social.technet.microsoft.com/wiki/contents/articles/walkthrough-of-windows-azure-sync-service-sample.aspx

     

    Tuesday, June 28, 2011 2:06 AM
    Answerer