I’m back (kind of)

I may be some time . . .

Hey everyone, anyone that knows me or knows of me might have noticed I’ve been a bit absent from conferences, blogging and social media for a little while now.

This was a conscious decision to step back from everything for a while following having to cancel my sessions the last couple conferences I had been selected to speak at.

The guys who run those conferences we’re so understanding and cool, another testament to the SQL Family 🙂

As I’m sure we all have had at some point, I’ve been through a bit of a rough patch in my life and I know it wouldn’t have been fair for me to keep cancelling on people (plus that sort of thing starts to damage your reputation, even with the awesomely understanding community)

Come back

All the above being said, I love being part of this community and sharing my little bits of knowledge with people is fantastic. So I’m planning to start building some new sessions in the new year and getting back to submitting sessions and blogging more etc.

I’m looking forward to getting back into it with everyone 🙂

See you soon!





SQLRelay 2014

Well this is my first blog post in a while! Sorry I’ve been so slack with it, you know how it is, life gets in the way Smile

So anyway, I’m currently sat in my hotel in “sunny” Newcastle all set to start the second part of my SQLRelay tour tomorrow.

If you’re here for the slides and scripts, scroll to the bottom of this post Smile

Part One

Day one

The first phase of my SQLRelay tour took me to first off to Reading, a great event at the Microsoft HQ. The rooms were great too, cinema style staggered seating and big comfy chairs. I had pretty much a full room and lots of good feed back.

Also had a chat with a few people about their query plans and issues that they were having. My query plans sessions always seems to get people thinking and its great to talk to people about their issues and how they are going about them (and also to be able to help out with some tips every now and then too Smile)


Day Two

Then it was off to Southampton (well Winchester but I wont pour any more petrol on that subject! Winking smile). Another great venue and a event, was good to see Steph and Nick that I’ve been working with a lot recently too.

Another good full room, lots of questions and some good feedback.


Day three

Next up was Bristol, I travelled up to stay with a friend right after the Southampton event, was good to have an evening to chill out. The Bristol event was good, I got to catch up with a few old faces and meet some new ones too!

My session seemed to go down well, lots of questions and good feedback too.

Day Four

The final day in this leg of the relay was Cardiff, the event was great and the venue was lovely. Very decorative and across lots of floors. My session was right up on the top floor, so I thanked everyone for making the climb Smile

Another really good session, had lots of questions and a very engaged audience. Also had a nice chat with a few people after my session.

The only issue I had in Cardiff was the road system and parking places, both of which were a bit of a mockery! Winking smile 

The car parks are certainly not designed for large rear wheel drive cars Smile


Part two

So this week I’ll be doing Newcastle, Leeds, Birmingham and then finishing up with London. I’m really looking forward to this week and meeting lots of new faces.

My flight in to Newcastle was very quick and mostly smooth and my hotel is nice too Smile



Slides and Scripts

Below is a list of links to my slides and scripts. Although I shouldn’t have to say this, I will. Please don’t steal my stuff and pass it off as your own (yes people have done this and I’ve caught them!)

If you want to use any of this content in your own presentations then please email me TSQLNinja@Outlook.com and we can discuss it Smile


Daves SQL Fun Time Hourhttps://onedrive.live.com/redir?resid=D8A9ABBFB8BB65E5!13628&authkey=!APofXkPcBjWzM9k&ithint=file%2czip

Query Plans Deep Dives –  https://onedrive.live.com/redir?resid=D8A9ABBFB8BB65E5!13627&authkey=!AA2r-9UhgUNXIgA&ithint=file%2czip

Stats, Estimation and Plan Caching –  https://onedrive.live.com/redir?resid=D8A9ABBFB8BB65E5!13626&authkey=!AJuBc0MDtvaqMA0&ithint=file%2czip

SQL Saturday Exeter 2014

Hi guys, so SQL Sat Exeter has once again come and gone and once again it was a fantastic, well organised event.


There were surfboards, Hawaiian shirts, palm trees, monkeys (of the inflatable kind) and even a few grass skirts!

Miss Ninja and I had a great time, so thanks for all that made it happen Smile


I was lucky enough to be asked to give a full day pre con and although it was an immense amount of work to put together it was more than worth it to spend a day with a fantastic group of attendees!

I also had a full room for my session on the Saturday too and, snoring man aside Smile (it was very hot in my defence) that seemed to go down very well too which is always great too!

So as promised I have attached my slides in pdf form and also the scripts to my demos.

Slight disclaimer on the demos, some of them have been written to work on tables and structures that I may have already had on my local database and that the scripts themselves may not set up. Also there’s are more than a few DBCC commands and changing of server and session variables so as always please use with caution! Smile

Slides and scripts available in the link below (Before clicking, please see my note at the bottom of this post):


Enjoy! Open-mouthed smile


Just a quick note: I’ve already had situations in the past where I have found people using my stuff without permission or crediting me in anyway so I’m putting this all up in good faith. Please don’t let me down internets Smile

Anyone that speaks / presents will tell you that a stupid amount of effort goes into putting these things together and I personally can’t think of anything more offensive that my hard work being stolen and passed off as someone else’s. That being said, I don’t mind if you want to use some of this stuff in your own presentations etc BUT please contact me first, I’m more than likely to say yes as long as I’m credited in where my stuff is used Smile

Record counts the easy way

I’m always surprised that so many people that use SQL Server rely on the old COUNT(*) to retrieve basic full table record counts. Doing it this way basically makes sql server read the whole table to give you a count of the records, something it actually already knows!

Try doing this instead, replacing [YOUR TABLE NAME] with … well yeah, you get it

SELECT SUM (row_count)
FROM sys.dm_db_partition_stats
AND (index_id=0 or index_id=1);

Do some comparisons of your own, do a COUNT(*) on a table and then do this.

Enjoy! 🙂

SQL Sat 194 – Exeter Pre Con


Hi all!

As you may or may not know, Dave Ballantyne and myself are lucky enough to be doing a pre con session at the up coming SQL Sat 194 in Exeter on the 8th of March 2013.

This is my first ever pre con session and I don’t mind telling you that, from my side at least, it has been a lot of work to put together. I’m not sure what I expected when Dave and I agreed to do it but it has certainly taken up a few evenings and weekends Smile

That being said, it’s been and labour of love and I’m genuinely really excited about spending a day with a group of people that have spent real cash monies to come and see Dave and myself. It’s genuinely a humbling experience when you think about it like that, so to all that are attending, thank you! Open-mouthed smile (There may also be some Haribo as a thank you as well on the day)

So, as a teaser for the people that are attending I thought I’d give you a sneak peak of what you’ve got to look forward to during the day:

  • Query Plan Deep Dives
    • Taking a deep look into statistics, plan caching and query plan internals and more
  • Procedural vs set based code
    • Looking at the performance implications of cursors, UDFs, TVFs, Recursive CTE’s and more
  • TSQL Myths and Misconceptions
    • Taking a look at common mistakes people make in sql server and TSQL coding and also challenging common misconceptions and misunderstandings
  • SQL Server 2012 TSQL Improvements
    • A good look at some of the new TSQL and other functionality of sql 2012

So there it is, I hope that will whet your appetite for getting stuck in on the day. If there’s anything any of you attendees want to take a specific look at then please either drop a comment on this post or drop me an email (davidmorrison2009 at googlemail dot com) and we will see what we can do

Look forward to seeing you in Exeter!


SQL Saturday 194 – I’m Speaking! (Yay!)

Hi all,


Bit of a belated post but I wanted to just share the news! Smile  As the post title implies I have had a session selected to present at the upcoming PASS SQL Saturday Exeter event.

Not only that but myself and Dave Ballantyne were also lucky enough to be offered the opportunity to do a whole days pre-con session as well! (http://sqlsouthwest.co.uk/SQLSaturday_precon.htm#pc1)

This will be my first ever pre-con session so if you’re coming, be gentle with me! Winking smile There may also be some haribo and other goodies in it for you when you come along!

I’m always genuinely excited and also very humbled whenever I get a session chosen to present, there are a whole host of very smart people out there who have a lot of really interesting and clever stuff to say, so its always genuinely an honour. So thank you to everyone that voted for my session Open-mouthed smile

If you are coming along to SQL Sat Exeter then please find me and see me and say hi! It’s always good to put faces to (twitter) names. I’ll also have the lovely miss Ninja is tow as well as I have convinced here that being a SQL geek is where it’s at! Winking smile

Anyway, hope to see you in Exeter!



What’s your leash?

Hi all, not a technical post today but more food for thought. I’m going to relate it mainly to career progression but to be honest it applies to all aspects of life (Get me being deep! Smile)

Anyway . . .

So, the other day I was walking back from my local super market, I came to a long stretch of path, quite wide with greenery on either side. Coming up from the other direction was a guy with quite a large dog. The guy looked respectable enough and to be honest big dogs don’t really bother me that much so I thought nothing of it.

As we got a little closer to passing each other I noticed this was a Rottweiler, it was a big strong and proud looking animal and looked quite happy to be plodding along by its owners side. Again I thought nothing of it as I spent a fair few hours around rescue Rottweiler’s as a kid and know first hand that the majority of them and big soppy softies! Smile

Just as we went to pass each other the dog decided it wanted to come and say “hi” to me (There was no malice in its action, I’m pretty sure it was just being friendly), the owner noticed this and simply gave the dogs leash (lead) a gentle tug and said something along the lines of “come on” to the dog and we all went on our way.

As I was walking back to my place I started to think about the dog and its owner and that little scenario I just described. As I thought about it some more I realised was that the reality of the situation was if that dog really wanted to make its way to me, be it to just say hi or to cause me harm, there was very little myself or the owner could have done about it, due to the large and muscular nature of the animal. Yet all the owner had to so was give the littlest of tugs and a gentle word and this strong and proud animal continued on its way.

Again this got me thinking as to how this situation could come about, if this was a “wild” animal on a lead it wouldn’t of happened, so I mentioned it to a friend of mine who trains dogs for a living. He said its all to do with conditioning from when they are pups, basically when they are small, that gentle tug on the lead and the gentle word are much more forceful. He went on to explain that effectively this idea of you being bigger and stronger than them just kind of sticks in there head and this is why the behaviour I saw was possible.

All interesting stuff, you might be thinking, but what has this got to do with me?

Mental Leash

Although we as human being obviously don’t get lead around on leash on a day to day basis, we are however held back by our own mental leashes.

As part of my job, I get to travel around a lot and go into a whole host of companies of differing size and ethos and the one common thing I can say every where I go is that I see is people being lead around by their own mental leashes, being held back by their own insecurities, fears and in some cases even laziness and lack of motivation. People stuck in a rut or stubborn in their ways. All these things have been built around experiences from the past, both positive and negative, just like a puppy is trained that its pointless to pull on its leash or that no means don’t do that.

People that allow themselves to be lead totally around by their leashes, generally speaking, are the ones who’s qualifications are from years ago, that haven’t been on a course or attended a user group / seminar or brought a book on their particular area of study for years. They end up stuck in the same role for the same company for umpteen years and get institutionalised.

All of these things can be a metaphorical leash around your neck being given a gentle tug, or the metaphorical firm word directing you away from what you want.

Now at this stage, so I don’t start to sound like a holier than thou tool, I’d like to point out that I’m far from perfect, I have a lot of my own “mental leashes” and over the last year or so I’ve been slowly trying to remove them, some more successfully than others. I still have quite a few but I try not to let them pull me around quite so much

So, what’s your leash?

My challenge to you all reading this now is to think about your leashes, what are the things that might be holding you back. Is it that little voice inside that says “cant” or maybe that fear you get when something new comes along?

Whatever they are, identifying them is the first step, and then pulling against them / removing them so you can approach that metaphorical hansom stranger and say “hi” without getting that tug around your neck

Final thoughts

Anyway this was just something that’s been on my mind and I wanted to share it, I hope you’ve found it interesting. Please feel free to drop me any comments as I welcome all feedback