Lesson Learned #26: How to change the definition of table triggers at the same time

Today, we have been working a very interesting case, when our customer is migrating their database to Azure SQL Database. We have found an incompatibility issue, because all triggers have an error handler with this syntax: raiserror @errno @errmsg to inform the error happened, but, this syntax is not supported for Azure SQL Database. To fix this…


Connect from Power BI to Azure SQL Database using AAD authentication

Currently Power BI doesn’t support AAD authentication when connecting to Azure SQL Database, but using Microsoft ODBC Driver 13 it is possible to do it. You can download the driver from here (ODBC Driver 13.1) and install it. After installing the driver, you can connect to the Azure SQL using ODBC connector. Select ODBC and…


Lesson Learned #25: Export/Import Azure SQL Database using Azure File Service?

In some situations, we need to import or export our Azure SQL Database using SQLPackage, but, unfortunately, either source and destination file we cannot specify a blob storage, in case that we want to save the file in this storage. For this reason, we have to use a local temporal folder for uploading/downloading the file depending on our needs. However,…


Exported database from Azure SQL failed to be imported to Azure SQL or to local SQL Server

Symptoms:  When using blob auditing on Azure SQL Server or Database, after you export database to .bacpac file if you import the database to another Azure SQL DB that already have blob auditing enabled at the server level you may get this error message: Could not import package. Error SQL72014: .Net SqlClient Data Provider: Msg…


Quickly test connectivity from Azure Website to SQL DB

In case you have an Azure Website and you need to confirm that your website can reach SQL Database service here is a quick and simple way to test it: 1) navigate to Kudu (it can be accessed at https://{yourwebsitename}.scm.azurewebsites.net ) (Kudu is the engine behind git/hg deployments, WebJobs, and various other features in Azure…


Lesson Learned #23: How to add AAD Security Groups to Azure SQL Database?

In these days, we are receiving multiples cases where our customer needs to add Azure SQL Database groups from Azure Active Directory. This is an example to how to archive it. Using the Portal in Azure: I created a user called SQLMember. I created a group called SQLGroup, adding the member SQLMember.   Using SQL…


Lesson Learned #22: How to identify blocking issues?

Today, we were working on a service request where our customer reported that, some TRUNCATE executions are taking more time that they expected. Normally, these TRUNCATE commands just only take 3 or 5 seconds to complete, however, this time, the problem is that they never finish. Using the following TSQL command: select conn.session_id as blockerSession,conn2.session_id as…


Automate Export Azure SQL DB to blob storage use Automation account

I had a support case recently question how to automate Export Azure SQL DB to a storage account (Blob container) to .bacpac files. The first attempt was made to configure a PowerShell Script to Export Azure SQL DB to blob container and to .bacpac format from here . this was successfully completed but on demand, the coming…