SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Books of 2016

I set myself a reading goal of 75 books for last year, and managed 73. I’m not overly happy about that, there were months where I barely managed to read anything

The full list, with Amazon links is at the end of this post, I’ll mention a few of the… Read more

2 comments, 219 reads

Posted in SQL In The Wild on 3 January 2017

What is a SARGable predicate?

‘SARGable’ is a weird term. It gets bandied around a lot when talking about indexes and whether queries can seek on indexes. The term’s an abbreviation, ‘SARG’ stands for Search ARGument, and it means that the predicate can be executed using an index seek.

Lovely. So a predicate must be… Read more

1 comments, 480 reads

Posted in SQL In The Wild on 13 September 2016

SQL Server 2016 features: R services

One of the more interesting features in SQL 2016 is the integration of the R language.

For those who haven’t seen it before, R is a statistical and data analysis language. It’s been around for ages, and has become popular in recent years.

R looks something like this (and I… Read more

2 comments, 327 reads

Posted in SQL In The Wild on 24 May 2016

Upcoming conferences

It’s shaping up to a busy year for conferences, well busy by my standards that is. While I’m unfortunately missing SQLBits, I’ll still be getting a chance to enjoy an English summer.


The InsideSQL conference is a new conference organised by Neil Hambly. It’s a deep-dive conference, with longer… Read more

1 comments, 413 reads

Posted in SQL In The Wild on 26 April 2016

SQL 2016 features: Stretch Database

Stretch database allows for a table to span an ‘earthed’ SQL Server instance and an Azure SQL Database. It allows for parts (or all) of a table, presumably older, less used parts, to be stored in Azure instead of on local servers. This could be very valuable for companies that… Read more

4 comments, 2,072 reads

Posted in SQL In The Wild on 19 April 2016

SQL Server 2016 features: Live query statistics

Ever wanted to look at a query’s actual execution plan (execution plan with runtime information) without waiting for the query to finish? Now you can.

Enable that and run a query, and you get an execution plan immediately, one with a few more details in it than we’re used to. Read more

0 comments, 247 reads

Posted in SQL In The Wild on 12 April 2016

SQL Server 2016 features: Query Store

Given that SQL Server 2016 is coming ‘real soon now’, it’s probably well past time that I write up some thoughts on new features.

The first one I want to look at is a feature that I’m so looking forward to getting to use, the Query Store.

Query Store is… Read more

0 comments, 277 reads

Posted in SQL In The Wild on 29 March 2016

Monitoring wait stats

This post, like last week’s, is based off the presentation I did to the DBA Fundamentals virtual chapter.

The request was for more details on the method I use to capture wait and file stats on servers, The methods are pretty similar, so I’ll show waits.

This is by no… Read more

4 comments, 1,802 reads

Posted in SQL In The Wild on 23 February 2016

Q&A from the DBA Fundamentals Virtual Chapter presentation

A couple weeks ago I presented to the DBA Fundamentals virtual chapter. The presentation was recorded and is available from their site.

While I answered some questions during the presentation, I couldn’t answer all of them. Hence this blog post with the rest of the questions and some answers.


Read more

0 comments, 274 reads

Posted in SQL In The Wild on 16 February 2016

and other pointless query rewrites

In a similar vein to last week’s blog post… I heard an interesting comment recently. “Change that Column != 2 to a Column > 2 or Column < 2 combination, it can use indexes better.”

Sounds like something that clearly needs testing!

I’ll start with simple numbers table.


Read more

6 comments, 1,736 reads

Posted in SQL In The Wild on 9 February 2016

On the addition of useless where clauses

I remember a forum thread from a while back. The question was on how to get rid of the index scan that was in the query plan. Now that’s a poor question in the first place, as the scan might not be a problem, but it’s the first answer that… Read more

4 comments, 2,221 reads

Posted in SQL In The Wild on 2 February 2016

Does an index scan always read the entire index?


That’s a bit short for a blog post, so let me explain. First, the difference between a seek and a scan.

A seek is an operation which navigates down the index’s b-tree looking for a row or for the start/end of a range of rows. A seek requires a… Read more

5 comments, 296 reads

Posted in SQL In The Wild on 26 January 2016

Stop using Task Manager to check SQL’s memory usage!

There’s two fairly common questions I see on the forums around SQL Server’s memory usage. Either the question asks why SQL’s using too much memory, or why it’s using too little.

Too much memory isn’t usually a real problem, it’s often due to max server memory being left at its… Read more

6 comments, 447 reads

Posted in SQL In The Wild on 19 January 2016

Natively compiled user-defined functions

One new thing that SQL Server 2016 has added is the ability to natively compile user-defined functions. Previously, native compilation, part of the hekaton feature, was limited to stored procedures.

When I saw that, the first question that came to mind is whether natively compiling a scalar function reduces the… Read more

10 comments, 1,648 reads

Posted in SQL In The Wild on 12 January 2016

Book Review 2015

It’s been a few years since I wrote a review of books I’ve read, so this isn’t going to list everything I’ve read since 2012, just a few of the best books or series. For the entire list of all books, see the library page.

So, 2015. I set… Read more

1 comments, 1,504 reads

Posted in SQL In The Wild on 5 January 2016

When naming transactions causes an error

For the last part of the series on transactions, I’m going to look at a problem that I ran across entirely by chance while doing some performance tuning. A procedure had a transaction in it, and it was named. Something like this:



Read more

4 comments, 1,804 reads

Posted in SQL In The Wild on 15 December 2015

Why would you want to name a transaction?

Something that i keep seeing in documentation, in forum code and in real systems is transactions that have names

BEGIN TRANSACTION VeryImportantProcess

<do stuff>

COMMIT VeryImportantProcess

Now the question came up on the forums a while back as to what the point of this is. Why would you name a… Read more

9 comments, 2,369 reads

Posted in SQL In The Wild on 1 December 2015

Savepoints and conditional transactions

This is the second in a short series on transactions. In the previous part I discussed nested transactions and showed that they actually don’t exist. SQL has syntax which may suggest that nested transactions exist, but it’s just a syntactical lie.

One thing I suggested in that post was that… Read more

3 comments, 1,504 reads

Posted in SQL In The Wild on 17 November 2015

A Mess of Nested Transactions

Transactions are an area that I often find are used badly, or not used at all. Transactions without any error handling, nested transactions, named transactions named for no good reason or just plain lack of transactions where they should be used.

This is going to be the first of three… Read more

2 comments, 302 reads

Posted in SQL In The Wild on 3 November 2015

Of clustered indexes and ordering

There is a particularly irritating and persistent belief that indexes (usually it’s the clustered that gets picked on) are always physically ordered within the data file by the key columns. That is, that the data within the database file is always ordered by the key column.

It doesn’t help that… Read more

10 comments, 2,541 reads

Posted in SQL In The Wild on 20 October 2015

Older posts