How to run aspnet_regsql on Azure SQL database

One of the first things you may find yourself wondering about when creating an Azure SQL database is how to have ASPNETDB installed in. If you try to use aspnet_regsql you will be frustrated by the error:

Setup failed. Exception: An error occurred during the execution of the SQL file 'InstallCommon.sql'. The SQL error number is 40508 and the SqlException message is: USE statement is not supported to switch between databases. Use a new connection to connect to a different Database.

which means SQL Azure simply does not support the USE statement, really.

Fortunately, Microsoft has created a hotfix to work around this problem. Download and extract the contents of aspnet_regsqlazure.zip then open a command prompt and navigate to the folder where you extracted the files. Enter the following command to have the job done:

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

 

Share


Έχουν δημοσιευτεί Τετάρτη, 22 Μαΐου 2013 9:41 πμ από το μέλος dpant
Καταχώρηση στις κατηγορίες: ,

Σχόλια:

Χωρίς Σχόλια