Use SQL Trace to capture database errors

Month: September 2020

Use SQL Trace to capture database errors

This is a link to previous related posts that you may find interesting https://sqlserverutilities.com/maximize-sql-trace/ https://sqlserverutilities.com/use-sql-trace-to-capture-database-exceptions/ If we want to capture all the commands being sent to the database engine we should capture just these 2 events: SQL:BatchCompleted and RPC:Completed. By doing so we guarantee to be capturing all executions sent to the database engine which …

Use SQL Trace to capture database errors Read More »

Use SQL Trace to capture database exceptions

For the previous post discussing SQL Trace see this post For the TraceExceptions stored procedure presented in this post see my Traces project at Github.  Capturing all the exceptions that occur in the database engine has been proved to be very useful in my experience. Actually, when thinking about it, I realize most DBAs do …

Use SQL Trace to capture database exceptions Read More »

Using a startup Stored Procedure in SQL Server

SQL Server allows marking any stored procedure as a “startup” procedure which means it will get executed upon a service restart. A “startup” procedure has to reside in the master database and cannot accept input parameters – cool, this is something we can live with. I find this option to be very simple and practical …

Using a startup Stored Procedure in SQL Server Read More »

Use SQL Server’s missing indexes feature

SQL Server exposes missing indexes metadata via the following 3 DMVs (Dynamic Management Views) sys.dm_db_missing_index_details,  sys.dm_db_missing_index_groups and sys.dm_db_missing_index_group_stats which combined in a simple query return valuable information of indexes that were detected as missing by the Optimizer and logged in those DMVs. The information in these DMVs is updated by the execution of every query …

Use SQL Server’s missing indexes feature Read More »

Implement SQL Server Agent Jobs with AlwaysOn Availability Groups

In this post I talk about SQL Server Agent jobs when implementing AlwaysOn Availability Groups. AlwaysOn Availability Groups synchronizes the databases that are part of an Availability Group but any other object that is not part of these databases do not get synchronized (i.e. logins, linked servers, operators etc.) and this includes SQL Server Agent jobs. For …

Implement SQL Server Agent Jobs with AlwaysOn Availability Groups Read More »