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

Do what I say, not what I do

 
You’ll hear a lot of rules and best practices from senior IT people (not just data folks, all of them). You’ll also then see those same people do what they told you not to.

That doesn’t seem fair, does it?

It is and it isn’t. Take NOLOCK as an example. I tell people “Don’t use NOLOCK”. In fact, I’ve done a number of rants about it. But I do use it every now and again. Want to know the difference? I know when NOLOCK is appropriate.

Tools are just that, tools. They can be useful or they can cause damage if you don’t know how to use them. Some tools get misused so frequently that senior IT people start telling everyone “do not use” because the chances of them being used correctly are slim, and conversely the chances of them being misused are great.

The simple answer is to just explain how to use the tools correctly right? In a perfect world, yes; that would be the correct thing to do. Unfortunately, not everyone understands what you are teaching. And certainly not everyone understands it the first time, or the second, or the third etc. Not because they aren’t smart enough, or not paying enough attention, but because it’s the nature of learning.

Let’s say I explain to someone how to use a cursor, because hey, even in a batch environment we do need loops sometimes. Then a few weeks later I realize they have started using cursors all over the place, performance is tanking, and they are now getting in trouble. Now I feel terrible. And in some cases, I (and cursors) get blamed for things not going well. It would have been easier in the long run, and safer, if I’d never shown them the tool in the first place.

So when you hear “Do not use this tool” from someone who really understands it, it’s probably because it’s a tool that gets misused far too often for the comfort of the person talking. In my opinion, at this point, you want to find out why using this tool is a bad idea. Find out what it’s used for and when it’s appropriate to use it. Once you are sure you have all that down, then, under the right circumstances, you can use the tool.

On the other hand, if you hear “Do not use this tool” from someone who doesn’t understand it, it may very well be that they have tried to use it incorrectly and run into problems. At this point you want to find out why (and/or if) using this tool is a bad idea. Find out what it’s used for and when it’s appropriate to use it. Once you are sure you have all that down, then, under the right circumstances, you can use the tool.

Ok, all of that said, there are things you shouldn’t ever do. The trick here is again, learning. Granting everyone sysadmin on a SQL instance really is a bad idea. Don’t do it. Learn why, when, and where sysadmin should be granted. And then when you have you’ll realize you still shouldn’t be granting it more than absolutely necessary.


Filed under: Microsoft SQL Server, SQLServerPedia Syndication Tagged: best practices, Microsoft

SQLStudies

My name is Kenneth Fisher and I am Senior DBA for a large (multi-national) insurance company. I have been working with databases for over 20 years starting with Clarion and Foxpro. I’ve been working with SQL Server for 12 years but have only really started “studying” the subject for the last 3. I don’t have any real "specialities" but I enjoy trouble shooting and teaching. Thus far I’ve earned by MCITP Database Administrator 2008, MCTS Database Administrator 2005, and MCTS Database Developer 2008. I’m currently studying for my MCITP Database Developer 2008 and should start in on the 2012 exams next year. My blog is at www.sqlstudies.com.

Comments

Leave a comment on the original post [sqlstudies.com, opens in a new window]

Loading comments...