T-SQL

APPROX_COUNT_DISTINCT()

APPROX_COUNT_DISTINCT() is a nice new function announced currently to be in public preview for Azure. Being well known for Oracle users is now joining (like many other things:)) also the Microsoft world. This function is designed to provide aggregations across large data sets where responsiveness is more critical than absolute…
T-SQL

Removing decimal places from a number without rounding

ROUND() is a well-known function in SQL Server. Most of us know only that two parameters can be used like ROUND(99,95, 2). This will do standard mathematical up/down rounding of numbers in the first parameter for the number of decimal places from the second parameter. But there is also an…
Azure

Backup and restore database in Azure Storage Account

Creating backups of user databases from an on-premise environment to Azure Blob Storage is an easy task. You need to configure Storage Account in Azure where your database backups will be sent. Then you can reference this newly created storage container directly from SQL Server Management Studio when creating a…
T-SQL

Concatenating strings in T-SQL

It may look like an easy task to concatenate string in T-SQL at the first look. But it still has some hidden points where beginners are failing most of the time. There are a few very important things to remember when working with string and doing concatenation. Without respecting them…
Azure

Linked Server from on-premise to Azure SQL Database

If there is a need to move data between local SQL Server instances (on-premise) and Azure SQL Databases we can use Azure Data Factory. But it isn’t the ideal solution all the time: it’s paid in some scenarios and not everyone is familiar with it. And the most critical issue…