Category: SQL Server Security
This category contains all SQL Server security related articles.
-
Management Studio tip – A menu driven RunAs launcher batch file to open SSMS using multiple different login credentials
Tired of repeatedly launching SQL Server Management Studio (SSMS) with different Windows accounts? This post provides a lightweight, menu-driven batch file that lets you choose the required security context and open SSMS instantly. It’s a simple productivity tool that’s ideal for DBAs and developers who regularly work across multiple domains, environments, or privileged accounts.
-
dutyDBA Case Files #2 – Who dropped the tables and deleted/recreated stored procedures on the production database?
In this edition of dutyDBA case files, I show you how to investigate an unauthorised production database change to figure out who made the changes. This walks you through the process of recovering from the application outage, and identifying the root cause.
-
Audit SQL Server login activity with Extended Events: Who connected, when, from where, how often & verify connection pooling
This article provides you with a stored procedure that sets up an Extended Events session in SQL Server to track all the successful logins. It then summarises the data from the .XEL file into usable format, so you can see which logins are connecting from where, via which application, how often they connect, is connection…
-
Script to generate the setspn commands required to create/register SPNs for Always On & standalone SQL Server service accounts
This article offers a script that generates all the necessary setspn commands required to create the SPNs for Always On and standalone SQL Server instance service accounts. Once you run these setspn commands, the SPNs get created and registered in the Active Directory (AD)
-
How to identify and fix all logins with invalid default databases? (Error 4064)
This article shows you how to identify all those logins on your SQL Server instances which have an invalid default dataabase that no longer exists. This article also shows you how to manage this situatoin, and provides you a stored procedure that resolves the issue.
-
What is SQL Injection? How to prevent it? Examples, best practices, tips and tricks to safeguard your SQL Server databases
This article explains what SQL Injection is, how it works, with easy to understand examples. It also discusses the preventive measures you can take to defend against SQL Injection, along with security best practices, tips and tricks
-
SQL Server Orphan Users and Logins – how to prevent and manage them, and the gotchas to be aware of
This article discusses what are SQL Server orphan user and logins, how to prevent users and logins getting orphanned, and how to manage them. It also talks about the security risks associated with orphan AD/Windows groups.
-
How to check the correct Windows Defender antivirus (AV) exclusions are in place for SQL Server?
Most enterprises run some sort of Antivirus or endpoint protection software on their servers including on SQL Server estates. The software choice depends on things
-
How to generate simple or complex passowrds and numeric OTP codes using T-SQL?
Generating random passwords and One Time Passcodes (OTPs) is a pretty common requirement. I am sure you can find several different versions of T-SQL code
Latest Articles


