-->

How do i run aspnet_regsql on sql azure? [duplicat

2019-03-27 08:15发布

问题:

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.

回答1:

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


回答2:

Membership Provider generated by aspnet_regsql.exe is out dated.

Please use new Universal Providers which is Azure compatible.

Update - 7/23/2015

Microsoft has new membership called Identity. Current version is 2 as of this writing.