List Recently Created Objects

The code below provides a list of all SQL Server objects created in the past “x” number of days. Dynamic T-SQL is used to construct a query for each database, including system databases. Each query…

Blocking Example Code

In our previous post we looked at detecting and analyzing blocking. This post contains a script with blocking example code. Output from the analysis samples contained in the previous post is also provided. Blocking Example…

Blocked Process Detection and Analysis

Blocked process detection provides the DBA an excellent tool for improving the apparent responsiveness of SQL Server. This post provides example code for creating a blocked process Extended Events capture session. Also included is a…

Example Deadlock Code

Deadlocks happen. As you’re about to see in this post, deadlocks are actually quite easy to create. In my previous post I showed how to monitor and analyze deadlock events using Extended Events. In this…

Deadlock Detection and Analysis

Deadlock detection and analysis in SQL Server is important for the overall health of affected applications. This post shows how to setup an Extended Events session to capture deadlock details. It also provides a stored…

dbo – Database Owner

In SQL Server, the dbo or Database Owner is a server-level principal that has full access to the owned database. Microsoft’s best practices recommend creating a discrete user, either an Active Directory domain user or…