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

Sub query pass through

Occasionally in forums and on client sites I see conditional subqueries in statements. This is where the developer has decided that it is only necessary to process some data under a certain condition.  By way of example, something like this : Create...(read more)

Read more

10 comments, 3,505 reads

Posted in Dave Ballantynes blog on 22 March 2013

SQL Saturday 194

On the weekend of the 9th March 2013, the second SQL Saturday in the UK occurred.  A massive thank you must go to all the sponsors of the event, FusionIO, Confio, Nexus, Purple Frog, Redgate, Idera and Big Bang Data. Additionally big congratulations to Jonathan and Annette Allan, Thomas Rushton… Read more

0 comments, 646 reads

Posted in Dave Ballantynes blog on 12 March 2013

A year of SQL Lunchs

Time does fly, and happy birthday SQL Lunch UK.

It has been a year since the first SQLLunch UK, and over the year there have been 21 Lunchs with a total of 537 attendees.  OK, some of those will be the same people but in ‘conference speak’ each registration counts,… Read more

2 comments, 669 reads

Posted in Dave Ballantynes blog on 17 February 2013

Deploying SSRS artefacts using Powershell ( Simply)

As ive stated in the past,  i’m presently part of a team on an ALM project for a major UK based online retailer.  The aim of this project is to have fully automated app and database code and schema deployment, through development, UAT and finally live.

Most parts of this… Read more

3 comments, 3,442 reads

Posted in Dave Ballantynes blog on 12 February 2013

Photo cataloguer

If you are anything like me, by know you will have a few thousand digital images spread across multiple directories and heaven knows how many of those are duplicates!

Here’s a little powershell script I use to try and keep them in order,  it recursively scans a directory (hardcoded to… Read more

0 comments, 712 reads

Posted in Dave Ballantynes blog on 20 January 2013

Scaling out SQLLunch UK

As you may be aware, I have been running a lunch time user group ‘SQLLunch UK’  having stolen drawn inspiration from Patrick Leblanc (t|b) ’s SQLLunch webcasts.  These however are not traditional webcasts, as although we use remote speakers,  to watch you have to get away… Read more

1 comments, 640 reads

Posted in Dave Ballantynes blog on 11 January 2013

SSDT – TSQL Unit testing in multiple environments

Late in December, one the long awaited portions of functionality inside SSDT was released to an eager public, that being unit testing.  There has been a lot of noise generated about sql unit testing as a concept recently and hopefully you have decided that that is now the way to… Read more

2 comments, 1,697 reads

Posted in Dave Ballantynes blog on 7 January 2013

When is a whitespace not a whitespace ?

As I'm sure I must have mentioned in the past, I’m presently involved in a large ALM project at a client.  Part of this project is using Sql Server Data Tools (SSDT) to aid the developer experience and to establish the schema under source control as “The Truth”.

SSDT, has… Read more

1 comments, 1,421 reads

Posted in Dave Ballantynes blog on 4 January 2013

SQL Saturday 194 - Exeter

Many kudos goes to Jonathan and Annette Allen and the others on the team for confirming SQL Saturday 194 in Exeter on the 8th and 9th of March.  The event home page is here http://www.sqlsaturday.com/194/eventhome.aspx and I delighted that myself and Dave Morrison will be presenting a full day pre-con… Read more

0 comments, 860 reads

Posted in Dave Ballantynes blog on 6 December 2012

My new favourite traceflag

As we are all aware, there are a number of traceflags.  Some documented, some semi-documented and some completely undocumented.  Here is one that is undocumented that Paul White(b|t) mentioned almost as an aside in one of his excellent blog posts.

Much has been written about… Read more

0 comments, 963 reads

Posted in Dave Ballantynes blog on 6 December 2012

When row estimation goes wrong

Whilst working at a client site, I hit upon one of those issues that you are not sure if that this is something entirely new or a bug or a gap in your knowledge.

The client had a large query that needed optimizing.  The query itself looked pretty good, no… Read more

0 comments, 2,213 reads

Posted in Dave Ballantynes blog on 26 November 2012

Advanced TSQL training

Over the past few years, Ive had it on my to do list to write and deliver and full-scale SQLServer training course and not just an hour long bite size session at user groups and conferences.  To me, SQLServer development is not just knowing and remembering the syntax of commands. … Read more

0 comments, 1,000 reads

Posted in Dave Ballantynes blog on 28 October 2012

SQL Saturday 162

SQL Saturday 162 was a great event, kudos to the team involved and I took a lot of pleasure in presenting “What’s new in SQL Server 2012 – TSQL”.

A number of people asked for the scripts, they are now here : https://www.dropbox.com/s/11uykl749498cju/Whats%20New%20In%20SQLServer%202012-TSQL.zip


Any questions ? Please mail me… Read more

0 comments, 737 reads

Posted in Dave Ballantynes blog on 9 September 2012

Reporting on common code smells : A POC

Over the past few blog entries, I’ve been looking at parsing TSQL scripts in a variety of ways for a variety of tasks.  In my last entry ‘How to prevent ‘Select *’ : The elegant way’, I looked at parsing SQL to report upon uses of SELECT *. … Read more

1 comments, 1,773 reads

Posted in Dave Ballantynes blog on 29 August 2012

How to prevent ‘Select *’ : The elegant way

UPDATE 2012-09-12 For my latest adventures with TSQL Parsers please see this post.

I’ve been doing a lot of work with the “Microsoft SQL Server 2012 Transact-SQL Language Service” recently, see my post here and article here for more details on its use and some uses.

An obvious use is to… Read more

2 comments, 1,945 reads

Posted in Dave Ballantynes blog on 9 August 2012

Joining on NULLs

A problem I see on a fairly regular basis is that of dealing with NULL values.  Specifically here, where we are joining two tables on two columns, one of which is ‘optional’ ie is nullable.  So something like this:

i.e. Lookup where all the columns are equal, even when NULL.  … Read more

5 comments, 1,690 reads

Posted in Dave Ballantynes blog on 26 July 2012

Indexed view deadlocking

Deadlocks can be a really tricky thing to track down the root cause of.  There are lots of articles on the subject of tracking down deadlocks, but seldom do I find that in a production system that the cause is as straightforward.  That being said,  deadlocks are always caused by… Read more

1 comments, 3,603 reads

Posted in Dave Ballantynes blog on 13 June 2012

“Query cost (relative to the batch)” <> Query cost relative to batch

OK, so that is quite a contradictory title, but unfortunately it is true.  There is a common misconception that the query with the highest percentage relative to batch is the worst performing.  Simply put, it is a lie, or more accurately we dont understand what these figures mean.

Consider the two below… Read more

2 comments, 2,101 reads

Posted in Dave Ballantynes blog on 10 May 2012

Offset without OFFSET

A while ago Robert Cary posted an article on SQL Server Central entitled 2005 Paging – The Holy Grail which is, as the title would suggest about paging in SQL Server.  This article provoked some really interesting chat around the subject and is well worth a read.

This is now… Read more

6 comments, 1,980 reads

Posted in Dave Ballantynes blog on 26 April 2012

Parsing T-SQL – The easy way

UPDATE 2012-09-12 : For my latest adventures with TSQL Parsers please see this post

Every once in a while, I hit an issue that would require me to interrogate/parse some T-SQL code.  Normally, I would shy away from this and attempt to solve the problem in some other way. … Read more

2 comments, 9,167 reads

Posted in Dave Ballantynes blog on 13 March 2012

Newer posts

Older posts