Posted in SQL Server

Reviewing My Go-To SQL, Part 1

Recently, I was doing some performance testing and came to a realization – I think I’ve been using the same code for this since my SQL Server 6.5\7.0 days. Yikes!

Usually I am trying to look at two or more ways of writing something and figure out which one is faster. If I’m trying to improve bad code, I can keep the starting point and incrementally see if what I’m doing is improving it.

Continue reading “Reviewing My Go-To SQL, Part 1”

Posted in SQL Server, The Survey Project

All in the Family

allinthefamilyI wanted to spend some time looking at questions about people to see if we can fill out some of the Person table, or at least confirm it makes sense. So I’m going to start skipping around the survey looking at different questions to try to find more information for people.

The next group of questions about people have to do with parents and other relatives.

Continue reading “All in the Family”

Posted in SQL Server

My Late Assignment

I feel like I already broke my New Year Resolution. I wasn’t able to complete the January T-SQL Tuesday challenge on time. I’m hanging my head in shame.


But I found the subject really interesting and 2 other people blogged about the same exact topic I wanted to talk about so I think it’s still worthwhile to follow through on the challenge, even if I’m late to the party.

This month, Brent Ozar (b|t) challenged everyone to go to Microsoft Connect, find an item and write about it.

Continue reading “My Late Assignment”

Posted in SQL Server, T-SQL Tuesday

T-SQL Tuesday #85 – Restoring the Backups

TSQL2SDAY-150x150This month’s T-SQL Tuesday’s topic is about backup and restores. Thanks to Kenneth Fisher (b|t) for hosting this month!

The day before the topic was announced, I was working with another database system and I just wanted to do a simple backup and restore so I could reset my test database back to the point before my mistake in the script I was working on screwed things up. And I couldn’t do it. This wasn’t covered in the introductory admin class I took for this database system and I was feeling too dumb to figure out how to do it after doing a Google search on the subject. Backups and restores were some of the first skills I learned as a SQL Server DBA so it just never made sense to me that it wasn’t for other systems. On the most basic level, it’s about protecting your data – why is it not the first thing you learn? Maybe that’s just me….

There are a lot of details that can go into creating a backup strategy. But I want to talk about restores. Why? Because you do backups so you can restore them. (If I could remember who I heard this line from, I would give them full credit. But it’s too great of a line not use because it so true.)

In particular, I wanted to think about the reasons why we restore.

Continue reading “T-SQL Tuesday #85 – Restoring the Backups”

Posted in SQL Server, The Survey Project

How Old Are You Now?

Time to look at Question #2 of the survey:


Here we just have an age with no additional context. So it makes it a little more interesting to try to figure out what we want to do. This is why it’s so important when defining surveys these days to make sure you’re clear about how you want the answers to look. And it’s easy to do that when you have a good idea of how you plan to use that data. Unfortunately, we can’t revise this survey so we’ll go with what we have.

Continue reading “How Old Are You Now?”