When you run aspnet_regsql in the azure sql database, the error only occurs because SQL Azure does not support the USE statement to switch database contexts when executing commands with Azure SQL databases.
To get around this, Microsoft has created a hotfix. The following steps show how to use the tool provided by the fix.
- Download the aspnet_regsqlazure.zip file from the patch page .
- Extract the contents of the file to the local local hard drive.
- Open a command prompt and change to the directory in which you extracted the files.
Use the following command line to run this tool (if necessary, replace the server name, database name, login and password).
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
source share