Category Archives: T-SQL
-
A pattern to match correctly on a value or a NULL
1August 5, 2015 by Kenneth Fisher
As you may have noticed if you read my blog I learn a lot from trolling various forums. In this …
Continue reading -
Filtered Index restrictions and Kendra Little’s Index Quiz
Leave a commentJuly 20, 2015 by Kenneth Fisher
A few weeks ago I saw a tweet about Kendra Little’s (b/t) new SQL Server Quizzes. Of course I had …
Continue reading -
Blocking and deadlocking on purpose
Leave a commentJuly 1, 2015 by Kenneth Fisher
Blocking and deadlocking are not things you typically want to do deliberately. But sometimes you need to test error handling …
Continue reading -
Which user function do I use?
Leave a commentJune 24, 2015 by Kenneth Fisher
Earlier this week I was scripting out a table with some legacy columns (InsertDate and InsertBy for example). If you …
Continue reading -
Adding, altering or removing multiple columns from a table
2April 16, 2015 by Kenneth Fisher
I was recently asked to do some fairly heavy modifications to a table. It involved adding 6 new columns, removing …
Continue reading -
What is a CTE
1April 6, 2015 by Kenneth Fisher
CTEs (Common Table Expressions) are one of the most interesting and useful tools added to T-SQL in the last decade. …
Continue reading -
Clean out all bad characters from a string.
10March 25, 2015 by Kenneth Fisher
I have a customer who is having a problem with a load. He is getting a fair number of bad …
Continue reading -
Why not NOLOCK?
5March 18, 2015 by Kenneth Fisher
Most senior DBAs I’ve met shudder when they hear NOLOCK. Ever wonder why? For the same reason they shudder at …
Continue reading -
There are #temp tables and then there are ##temp tables.
Leave a commentMarch 16, 2015 by Kenneth Fisher
Temporary tables are a common enough thing in T-SQL that most of us have probably used them on a fairly …
Continue reading -
Who’s using that database?
Leave a commentMarch 9, 2015 by Kenneth Fisher
A common problem when trying to alter a database (take it offline, add a filegroup, whatever) is that someone else …
Continue reading




