Optimize SQL queries using subqueries for lookups in Azure SQL Databases

Optimize SQL queries using subqueries for lookups in Azure SQL Databases

I like to work with Azure SQL Databases and use data from the cloud without any administrative effort. When working with apps, App Insights helps to detect anomalies, and to analyze bottle necks. Although SQL Azure can scale very well, we discovered performance issues in some legacy apps. Read here how we solved that by optimizing TSQL data queries. The scenario There is an older web application here that is connected to an SQL database that is running in an SQL elastic pool. App Insights showed the reason (the SQL queries) for the bad performance. Diving deeper, the elastic pool and the database / Query Performance showed performance issues in detail with certain queries which had very long runtimes. As we see in the following screenshot, there are two long running queries. Query 164 has been executed almost 274,000 times in the past 24 hours, consuming more than 6:40 hours. We started to investigate this issue. ...

April 27, 2021 · 5 min · Toni Pohl
How to copy table data between Azure SQL Databases

How to copy table data between Azure SQL Databases

Working with Azure SQL Databases is handy. Just, how can I copy data from one Azure SQL database to another database? See the best practice here. I had such a use case. I needed to copy a table (all rows) from a source database to a destination database with SQL Management Studio. The table did not have much data, but extensive data with varchar(MAX) fields containing HTML and Base64 encoded images. So, a copy in the edit mode via clipboard did not work. ...

September 18, 2019 · 2 min · Toni Pohl