Create database on Azure SQL
TOpel
Posts: 2 New member
Hi,
We are investigating options to move our solutions into MS Azure. When using Azure SQL, it is apparently not possible to use the "USE" statement within a script. Does SQL Change Automation have some way of taking care of this issue or do we need to modify all current scripts that have the "USE" statement in them? I have tried setting the project's target platform to MS Azure SQL Database, but that does not seem to help.
Thank you for any help provided.
We are investigating options to move our solutions into MS Azure. When using Azure SQL, it is apparently not possible to use the "USE" statement within a script. Does SQL Change Automation have some way of taking care of this issue or do we need to modify all current scripts that have the "USE" statement in them? I have tried setting the project's target platform to MS Azure SQL Database, but that does not seem to help.
Thank you for any help provided.
Answers
If your existing scripts have USE statements, then you should remove them.
Product Support Engineer
Redgate Software Ltd
Please see our Help Center for detailed guides on how to use our tools
I don't know what I am doing wrong, but I am unable to deploy even a simple project to the Azure SQL. Here is a GitLab repository of the project I have tried. If I use the button to "Create database" I get the following error:
Azure SQL Database does not support switching between databases. Connect to [{dbname}] and then re-run the script.
I tried creating the database manually and then connecting to it, at which point the communication was successful and the DB was updated. Do I always need to create the DB manually first and then connecting to it directly in order to make SQL Change Automation work?
You can use the Pre-Deployment script for this if needed.
Product Support Engineer
Redgate Software Ltd
Please see our Help Center for detailed guides on how to use our tools