TSQL Script to Display Agent Job History

It can be a bit time consuming to work through the the SQL Server Management Studio (SSMS) user interface to check on the agent job history to find specific agent jobs that have been run. To help speed that process up,

Posted in DBA Tagged with: , , , , , , ,

SQL Server Script to Display Job History

Its not always quick and easy in SQL Server to get a full list of the jobs that have been run, when they were run and how long they took. I created the following script to quickly check on the

Posted in SQL Server, TSQL Tagged with: , , , ,

Database Corruption Challenge Week 7 – Alternate Solution

The alternate solution to the Database Corruption Challenge this week was created by Patrick Flynn. This solution is the only solution to successfully recover all the data without using any of the backups. If the challenge had been structured differently

Posted in Corruption Tagged with: , , , , , , ,

Using the TSQL GetDate Function

Here is a quick video tutorial on how to use the T-SQL GetDate function on SQL Server 2012, SQL Server 2014 or newer. This was originally part of my free SQL query training for the 70-461 certification exam. Here is the

Posted in 70-461 Training, TSQL Tagged with: , , , ,

DBCC ShrinkDatabase

Being day 24 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC SHRINKDATABASE. When I first heard about DBCC Shrink Database (many years ago), I immediately thought “what a great feature, run this every night when

Posted in DBCC Commands Tagged with: , , , , , , , , , , , , ,

Index Fragmentation and SHRINKDATABASE

Is it a good idea to run DBCC SHRINKDATABASE regularly? Download the sample file ShrinkSample. This article and samples apply to SQL Server 2005, 2008, and 2008R2. This really depends on a number of factors, but generally the answer is

Posted in Performance Tagged with: , , , , , , ,