T-SQL for identifying slow-running queries on a database

Views – 447

T-SQL to check the properties of all the databases on a server

Views – 526

How to shrink huge log files

Here is a short script to quickly shrink your log file if you DO NOT NEED to ever recover the database before the…

Some thoughts on auto-incrementing IDs

The implementation & syntax feels like an afterthought, like the engineers of SQL Server made something self-consistent, and then the market research wing…

Configure Email Alerts via T-SQL

You can run the following SQL script to ensure email alerts are configured for the LSCopy and LSRestore jobs:

Views – 450

Using the LIKE keyword more efficiently

from Pinal Dave’s article here: http://blog.sqlauthority.com/

The previous query does find FirstName values beginning with the letters ‘A’ thru ‘K’. However, when…

Using sp_WhoIsActive

Here is an awesome extentions of the sp_who and sp_who2 (undocumented) sprocs DBA’s use to see slow running queries etc. Download link for…

Keeping Indexes online while reindexing

This will also display the SQL Statement that is the offending blocker. Online index operations: Online index operations were added as an availability…