Skip to Content

TSQL Posts

Finding When Someone Last Ran a DBCC

Posted June 28, 2017

By

  The other day someone on Twitter asked how to find out when or who last ran a DBCC FREEPROCCACHE command on their SQL Server instance. Since this is not... more »
0

Stopping Execution of Future Batches

Posted February 17, 2017

By

  There is a command that as far as I can tell has been in the product since SQL2008 but I was woefully unaware of. Actually I find many others are... more »
11

July SSMS 2016 changes transaction semantics

Posted July 05, 2016

By

This can be a very nasty one if you’re not observant. The July update of SSMS now has the option to change XACT_ABORT setting for a query window using... more »
1

Updated File & Wait Statistics Procedures

Posted February 13, 2014

By

          Please note that I have a newer version of these procedures that you can find here... more »
2

sp_spaceused Alternative

Posted May 17, 2013

By

        I don’t know why but for some reason I have never liked using sp_spaceused. It probably started a long time ago when... more »
4

Fun with Aggregates

Posted March 11, 2012

By

There are interesting things to be learned from even the simplest queries.  For example, imagine you are given the task of writing a query to list... more »
11

Sorted views…

Posted November 28, 2007

By

Here’s one that pops up regurarly. Something like: “My views are no longer ordered in SQL Server 2005. I have ORDER BY in the view, but when I... more »
17

Is 'YYYY-MM-DD' always treated as year, month, date?

Posted August 04, 2007

By

Most of you already know the answer to this question: no. I won’t recap the rules for interpretation of the current datetime literals, as I have an... more »
3