Stored Procedure to Delete Duplicate Records in SQL Table

Sometimes during our run as DBAs, we come up across at least one table that is loaded with duplicate records. Even if the table has a Primary Key (an auto-incremental one in most cases), the rest of the fields might have duplicate values.

However, SQL Server allows for many ways to get rid of those duplicate records (e.g. using CTEs, SQL Rank function, subqueries with Group By, etc.).

CodingSight - Delete Duplicate Records in SQL Table
Read More

The Stored Procedure to Get the Instance Settings

SQL Server instances house databases containing the data for the backend stack of a business model, or configuration data for particular applications. Regardless of the use case, an instance has a set of values/settings that should be tuned to follow best practices.

The purpose of the Stored Procedure that I’m showcasing in this article is to present the DBA a set of important settings/values that shouldn’t be overlooked. Moreover, I will share a cool feature that help DBAs keep control of any particular setting/value that has been recently changed/modified.

CodingSight - The Stored Procedure to Get the Instance Settings/Values
Read More

A Dedicated Stored Procedure to Get the Latest Database Backups Status

Any SQL Server DBA (of course, this applies to all platforms) will agree that database backups are the most essential things for data professionals. Monitoring those backups’ statuses is crucial. To make this task more straightforward, I have created a custom Stored Procedure. It will allow you to get the latest database backups’ (if any) statuses for all the necessary databases under your care.

CodingSight - a Dedicated Stored Procedure to Get the Latest Database Backups Status
Read More

Transparent Data Encryption (TDE) in SQL Server in an AlwaysOn Availability Group on Example

Availability Groups are fantastic for High Availability/Disaster Recovery solutions, and I’m sure that fellow DBAs will agree with me. However, there will be times when we must consider certain precautions and extra steps carefully to avoid unwanted surprises. For instance, any Secondary Replica becomes the current Primary Replica for whatever reason, and our goal is to not let it happen.

CodingSight-Dealing with encryption of databases in an AlwaysOn availability group scenario
Read More