The following post shows my preferred way to automate / schedule some code against my Azure SQL Database. No it is not PowerShell or Azure Runbooks but it is definitely my favourite way.
If you read official Microsoft documentation about naming conventions for your SQL elastic pools, it is hard to find any guidelines on the subject. You are probably thinking it is not that big of a deal. I thought the same until I tried to execute some TSQL to move a database into an elastic pool.
Now that I have your attention with a powerful title how about some context? It is quite common to get this error message when trying to connect to your Azure SQL Database which obviously resides on a “logical” SQL Server.
You may (or may not) have a requirement to setup a linked server to Azure SQL Database from a locally installed SQL Server. One reason could be to pull down some reports from an Azure SQL Database to a local file share. Whatever your reason is hopefully you will find this blog post useful because I ran into some complications on the way.
So what is the default isolation level for Azure SQL Database? I ran the following code to check it out.
I do not always use the Azure portal to make database changes or to check for certain information. I use it a lot of for blogging purposes but for some tasks I rather just run code via SSMS – SQL Server Management Studio.
Last year I wrote about Azure SQL Database extended events (https://blobeater.blog/2017/02/06/using-extended-events-in-azure/) and gave an example where I was capturing deadlocks via the ring buffer. Ever since then I wanted to do a follow-up post but using Azure storage as the target for my XEL files.
This is more complicated than using the ring buffer as the target and requires a couple of things:
- Azure storage account where you create a dedicated container for the files.
- SAS key.
- Database master key.
- Database scoped credential.
As a mini project I wanted to use Azure logic apps to pull tweets from my twitter account when people were tweeting about #Azure / #Microsoft. From here I used cognitive services – sentiment analysis API which returns a numeric score between 0 and 1. Scores close to 1 indicate a positive sentiment and scores close to 0 indicate a negative sentiment. Then I wanted to put that data into an Azure SQL Database table and link it to Power BI because I wanted to see where in the world tweets were coming from and with what score.
Creating copies of your Azure SQL Database is a common and relatively simple process. You can issue a TSQL statement on the master database such as:
CREATE DATABASE CodeDBcopy AS COPY OF CodeDB