Skip to content

SQL Server

Microsoft SQL Server in practice: installation, Always On availability groups, backup and restore, performance tuning, security, PowerShell automation, SQL Server on Linux and upgrades.

SQL Server: How Correlation assumptions work for multiple predicates

SQL Server 2022 introduced “CE Feedback“, a feature that adjusts some Cardinality Estimation model assumptions at a query level by applying Query Store hints. In this blog post, I’ll use an example query from the CE Feedback documentation to look in more detail at how CE works. The goal is to better understand how SQL Server uses certain assumptions to… 

SQLBits 2023 -Day 1-A day with SQL Managed Instance

Tuesday 14.03.23 was the first day of SQLBits. This day was dedicated to the workshop, and I chose to follow “A Day with SQL Managed Instance”.During this day, we talked about provisioning, connection and configuration, security, but also data migration and mobility, monitoring, and performance. Last year, Microsoft developers made 42 improvements to the service SQL Managed instance. As you… 

Lost access to SQL Server. Now what ?

In this blog we will explain what to do to regain the access to your SQL Server instance. Here is our scenario : – You have by accident removed all logins in SQL Server instance – Your sa account by security and best practice is disabled – So no possibility to login with a sqlcmd or your SSMS (SQL Server… 

Maintenance Azure SQL DBs in Elastic Pool (Private Endpoint) – example based on index fragmentation – password less – azure managed identity

How do you check and rebuild your indexes for Azure SQL DBs in Elastic Pool? That question is getting even more interesting if you have only Private Endpoint enabled to connect to the MSSQL DB.  Lets get started!  Elastic Database Jobs So first, we need to check Elastic Database Jobs. Elastic Database Jobs (preview) – Azure SQL Database | Microsoft Learn … 

Move SQL Server database files to different folders with PowerShell

In my previous post, I explained how to move SQL Server databases files programmatically by leveraging the high availability of an Availability Group (AG).But when you can afford to have a database unavailable for a short time, and if it is of a reasonable size, then an offline approach may be desirable. This will have the advantage of also working… 

Move secondary database files in SQL Server AG with PowerShell

For some circumstances, you may want to move data and log files for a database to a different location.Usually, this operation has to be made offline. But with an Availability Group (AG) environment, it is possible to choose an approach which is slightly transparent. If you have a lot of databases to process, you may want to automate this operation:… 

Programmatically change the data source of a Power BI Report

Executive Summary In this post, I want to demonstrate how to programmatically change the data source of a Power BI report. This can be useful when you develop and test the report then want to publish the report in Test, QA and Production using different data sources. Prerequisite Step 1: The Power BI report It is important to define the… 

Disaster Recovery Solution to Azure SQL Database

Executive Summary As preparation for migrating his MS SQL workload to the cloud, a customer ask for a disaster recovery solution from an On-Premise MS SQL Instance to an Azure Cloud. The starting point for the disaster recovery will be the existing backup on a shared-disk in the On-Premise environment of the customer. I will export the database as BACPAC… 

A generic jdbc tester (part III)

A generic utility to test JDBC connections to any RDBMS or no SQL data source whose JDBC drivers are provided. Firebird, SQL Server, HSQLDB, MongoDB, Excel, conclusion.

SQL Server: Heap page deallocation and IndexOptimize

Introduction HEAP tables are a type of data structure that, unlike a clustered index table, does not have a specific ordering of its rows, making them faster to insert and delete data. They are often used for temporary “staging” tables. This is all fine. But, if your table is never dropped and reused over time for data loading, you need…