Search code examples
c#azureazure-sql-databasemembership-provider

How do i run aspnet_regsql on sql azure?


Possible Duplicate:
Migrating ASP.NET Membership Database to SQL Azure

How do I run aspnet_regsql on sql azure database? I made it work the hard way, by exporting all db objects over. However, I seriously believe that there's an easier way. Please help.


Solution

  • When you run aspnet_regsql on sql azure database, the error occurs only because SQL Azure does not support the USE statement to switch database contexts when it executes commands against SQL Azure databases.

    To work around this, Microsoft created a hotfix. The following steps show you how to use the tool that is provided by the hotfix.

    1. Download the aspnet_regsqlazure.zip file from the hotfix page.
    2. Extract the contents of the file to a location on your local hard drive.
    3. Open a command prompt and navigate to the directory where you extracted the files.

    Use the following command line to execute the tool (substitute your server name, database name, logon, and password where appropriate).

    aspnet_regsqlazure -s [your server name].database.windows.net -d [your database name] -u [your user name]@[your server name] -p [your password] -a mr