All posts by Sean McCown

I am a Contributing Editor for InfoWorld Magazine, and a frequent contributor to SQLServerCentral.com as well as SSWUG.org. I live with my wife and 3 kids, and have practiced and taught Kenpo for 22yrs now.

The Dumbest man on Earth -Follow-up

Since everyone is so interested, I thought I’d give some further observations about our favorite candidate.

1.  He was visibly shaking throughout the entire interview.

2.  He claimed that had he known there would be so many sql questions he would have studied.  He said he’d only need a couple days.  Frankly, I was VERY tempted to give it to him just out of morbid curiosity.

3.  He said that he had been concentrating on Access the past few months and that’s why he couldn’t remember any of the SQL Sever stuff.  But when I started quizzing him on Access he bombed that too.  And I only know enough about Access to barely get by.

4.  His nervous laughter wasn’t just time consuming, it was loud and annoying.  Everyone go ahead and ask Jen how much I adore loud obnoxious laughing when I’m trying to talk.

5.  He was actually pre-screened by the team doing the hiring.  I’ve since then heard that the guy who did the screening was very embarrassed that this guy turned out to be such a loser.

6.  The guy actually said he was sorry for being so disappointing.  I told him I rarely come into these things with any expectations so it’s impossible to be disappointed.  However, I did tell him I was quite pleased what what I got out of our discussion.

7.  I managed to hear a couple of the questions by the hiring manager as I was leaving and he was basically telling them that he would do whatever they wanted and was divorcing himself from any independent thought.  He wanted a job so badly.  Can you believe he’s a contractor?

8.  I knew this was going to be fun when I saw his resume claim that he had done SQL Server on VMS.

9.  One of the things I didn’t tell in the main post was that with a little prompting he WAS able to tell me the 4 basic steps to creating a cursor.  Funny isn’t it?  The only thing he got right was about how to use a cursor.  Run away very fast.

10.  After he blew the char() vs varchar() question so badly, I asked him the question about char() vs nchar().  Again the answer was I’m not sure where you’re going with that.  nchar()?  What is that, like a numeric Char()?

I’m sure there’s more in my brain somewhere, but that’ll do for now.

The dumbest man on Earth

This is one of the most incredible interviews I’ve had to date. It has plenty of very unique answers and lots of good old-fashioned awkward pause. I’m torn about how much to write down because it really gets kinda long after a while, but I’m likely to put a good deal of it though cause I know some of you will want to hang in there. So without further ado I’ll get to some Q/A.

Oh wait, I suppose I should explain the position first. I’m interviewing candidates for a group downstairs. They’re looking for a SQL guy to help them write reports, and support their current data processes and help support their new SSIS pkgs and do some SSRS stuff. He doesn’t have to know everything, but it would be nice if he had a working knowledge and could be taught. This guy has been doing this for many yrs and has a resume the size of mine. So he’s very experienced.

Q: What does sp_ in front of an sp signify?

A: It means it’s a system procedure supplied by MS.

Me: OK, and what does it do.

Him: Nothing, it just means that MS created it and gave it to you because they thought it was be useful.

Me: And can you create your own?

Him: Well of course. You can create as many as you like.

Me: So does that make them system SPs then?

Him: They’re SPs that were supplied by MS.

Me: Yeah, I got that part. How are they all supplied by MS if I can create my own? Will MS add mine to the product since I created them as system SPs?

Him: Yes. Any SP you add with sp_ will be uploaded to MS and will be included in a service pack.

Me: I don’t think I could have explained that any better myself.

Q: What are the 2 types of UDFs?

A: I didn’t know there were 2 types of UDF.

Me: Ok then.

(Now this one just boggles the mind)

Q: What’s the difference between delete and truncate?

A: I know there’s a difference but I can’t think of it. No wait, I remember. Delete deletes all the data in a table and truncate leaves space at the end.

Me: Pardon? Did you say that truncate leaves space at the end? Then end of what?

Him: Yeah, truncate leaves space but delete gets rid of all the data.

Me: Ok, so what if you only want to get rid of a few rows?

Him: That’s what you call a partial delete and you have to do that inside a transaction.

Me: Moving on…

Q: What are 2 types of cursors?

A: I know there are different types I just don’t know what they are.

(Actually one of the brighter things he’s said.)

Q: What’s the difference between Select Into and Insert Into?

A: Well, I don’t even know where you’re going with that. They’re 2 different statements and they do 2 different things. Yeah, I just don’t know where you’re going with that. It has to be somewhere though. Ok, let me think. A select statement is a query that you use to select data. And an insert you use to put data into a table. But you can use a select with an insert so I guess that makes them the same thing, so I don’t know where you’re going with that. Yeah, I just don’t know. Are you asking me if they’re different, because they’re not. Since you can use a select with an insert that makes them the same thing. Yeah, that’s right.

Me: I think you’ve misunderstood. There’s a select into statement, and there’s an insert into statement. They’re 2 different statements. I’m asking what each one does.

Him: But they’re the same thing aren’t they? Well, I mean except that one selects data and the other inserts it, but you can use them together so doesn’t that make them the same thing?

Me: Well, they both insert data, except the select into creates the table and the insert doesn’t. That’s not the only…

Him: Yeah, I know that. That’s what I was trying to say. Yeah, the select statement creates the table and the insert statement inserts data into it. Yep, that’s right.

Me: Well, that’s not entirely what I said, but let’s move on.

Him: Yeah, it’s close enough. I think we’re talking about the same thing. I’m still not sure where you were going with that though.

Q: What’s the difference between an SP and a trigger?

A: Again, I’m not sure where you’re going with this because a trigger calls an SP so that’s the difference. So a trigger is what calls an SP and the SP is what gets called. That’s the difference.

Me: Ok then. You don’t get any more succinct than that.

Q: What’s the difference between datetime and smalldatetime?

A: I’m not entirely sure what the difference is. I think that datetime only stores small dates and smalldatetime stores larger dates. No, that’s backwards. Datetime stores big dates like anything after say the 15th every month and smalldatetime stores dates from 1 to 14. Yeah, that’s right.

Me: So you’re telling me that I have to have 2 separate cols in my table for each half of the month?

Him: Well yeah. That’s why normalization is such a big deal because if you don’t create your tables properly you’ll be in big trouble because everything’ll be slow.

Me: I honestly don’t know what to say. I’ve never heard that explained in such a clear-minded fashion before. And to tie it back into normalization… just excellent.

(This is my gimme question, right? He’s done so poorly until now I really wanted him to get one.)

Q: What’s the difference between a clustered and a nonclustered index?

A: This is one of those interview questions and I don’t know where you’re going with this one either. I don’t understand this, this is one of those interview questions. This is one of those interview questions…

Me: I’m sorry, you keep saying this is an interview question, what do you mean by that?

Him: Well, this is one of those questions that they ask in every interview. And if you search for interview questions on the internet you usually come up with this one.

Me: So are you telling me that it’s purely an academic question then?

Him: No, I’m just saying that it’s a question you hear in every interview.

Me: Well, this is an interview so why don’t you answer it.

Him: Ok, well a clustered index is a global index. It’s open to everybody. And a nonclustered index is only available to certain people.

Me: I’m afraid I don’t understand.

Him: You don’t have to give permissions for a clustered index; it’s global. Everyone can see it. But for a nonclustered index you need to maintain security for it. It’s part of the MS security model.

Me: So what is it about a nonclustered index that makes you need to lock down security?

Him: I don’t know their reasoning. I just know that’s how it works.

Me: So what’s stored in a nonclustered index that makes you have to lock it down then? What info are you hiding from the general public?

Him: I’ve always wondered that. I don’t know. I just know that it makes the data more secure. That’s what all the documentation says anyway. So I don’t know where you’re going with this because this is just an interview question.

Me: Do yourself a favor and don’t say that again. I get it you think the question’s worthless.

Him: No, it’s not worthless, it’s just that it…

Me: Let’s move on before we get to the end of that sentence.

Q: Explain when you would use the ‘Having’ clause.

A: Well, ‘HAVING’ is not my forte. But it’s used when you can’t use the ‘where’ clause in the right place.

Me: When you can’t use the ‘where’ clause in the right place? I’m not sure what you mean.

Him: There are times when you can’t put the ‘where’ clause where it ordinarily goes so you have to use having.

Me: Can you name one of those times? Give me an example?

Him: Not really. That kind of thing is hard to nail down really. It’s random to begin with.

Me: Wait, what’s random?

Him: When you have to use ‘Having’. It doesn’t happen all the time.

Me: I can see how that would be hard to define something that keeps changing like that. Have you thought about asking MS to make that more stable so people know when to use it?

Him: No, I always figured it was something they couldn’t do or they would have.

Me: Would you be surprised to know that it has been stabilized?

Him: Really? When did they do that? In this last version? Cause I haven’t played with the new one yet.

Me: No, they stabilized it about 25-30yrs ago. I can’t watch you struggle through this anymore. Would you like me to give you the well-kept secret of the ‘having’?

Him: Sure.

Me: ‘Having’ is like a where clause for a ‘group by’. So if you get a result back from a ‘group by’, say you’re counting how many of each value is in a table with something like Select CustID, count(*) as CT from orders group by CustID, then that’s a result you’re getting back from a ‘group by’. You can see how many orders each customer has had. But if you want to see only customers who have had more than 100 orders, then you would add ‘having count(*) > 100’ and you’ll now only see the ones who have had more than 100 orders. So it’s really kind of a ‘where’ clause for a group by. It doesn’t move. It’s not mysterious. And there’s no secret potions or incantations you have to apply to make it work from one day to the next.

Him: Wow, yeah that makes a lot more sense. See, this is why I need to work here because I feel I could really learn from someone like you.

Me: And furthermore… I’m pretty pissed off that you would even waste my time like this. You’re clearly a complete idiot. In the 20+yrs you’ve been doing this you’ve clearly never once opened a single book. I mean, what the hell kind of moron thinks that this shit is all voodoo that nobody can understand? Computers are solid and predictable and you’re an idiot. I mean, seriously, did you really think that SPs you create get uploaded to MS and included in service packs?

Him: Well I always…

Me: Shut up. I don’t even want to know the answer. I’m afraid some of your stupid will get on me and I’ll step into the street in front of a car. I suggest you do something more suited to your intellect. Just remember, when the buzzer goes off, it’s time to pull the fries.

Ok, I made the part in blue up. I was actually very nice to him. But it sure felt good to say all that here.

So ok, that was my interview yesterday. All of these stupid answers are not only completely real, but they were compounded by his nervous laughter. So for every answer there were a couple senseless jokes and about 30-45secs of him laughing at them.

And I don’t know about you guys, but all of the stupidity aside, I find the bit about some of those being interview questions particularly puzzling and somewhat offensive. That’s implying that these questions are useless and have no place in your day to day life.

So there you go… that’s the interview as best as I can recount it. I was taking some notes while he was talking, but I didn’t do some of them justice. Hell, just not being able to convey his laughing all the time really makes you miss an essential part of the experience. And I’m doing more interviews for this group so there’ll be more coming.

Even MVPs make mistakes

We’re in the middle of our last mock go-live before this weekend’s prod change-over.  We’re using an SRDF process to move the DB files from the current prod to the new prod.  This is our big SQL R2 cluster and what usually happens is that they present the drives to the cluster and then I run my script to bring the DBs back online.

Well what happened this time is that the drives weren’t added as SQL dependencies and therefore SQL couldn’t see them in order to bring the drives back online.  Well, I didn’t think to check that.  Instead what I did was I just deleted the DBs thinking that just starting from scratch would be the best way to go.  What ended up happening though is that SQL deleted the newly presented data files.  So the moral of this story is that even though SQL can’t see the drives to be able to attach the files, it can apparently see them well enough to delete them behind your back.  Thanks clustering team!

And so this isn’t entirely just a complaining session, here’s the query you can use to see which drives your clustered instance of SQL can see.

SELECT * FROM sys.dm_io_cluster_shared_drives

Now I’ve you’ve got drives in the cluster that SQL can’t see, all you have to do is add them as a dependency to the SQL service and you’ll be fine.  And in Windows 2008 you can do that while the service is online, but in 2003 and below you have to take SQL offline to add them.

Oh, and just for completion, you can tell which nodes are in your cluster by using this:

SELECT * FROM sys.dm_os_cluster_nodes

Here’s a quick update:  The errors I caused and fixed this morning had some residual problems.  Because once you make a mistake and try to fix it, you’ve already got mistakes on your mind and you’re not thinking clearly.  This is why I’m always advocating having restore scripts ready to go in a manner that you don’t have to think about it in a crisis.  You always want things to be as easy as possible.  And this is also why I’m always saying that you should have standardized troubleshooting scripts and everyone should know how to use them.  You don’t want individual DBAs inventing new methods on the fly.  You should all know what scripts are being run to troubleshoot if at all possible.

What does a bad query look like?

In my SQL Marklar blog today I discussed troubleshooting DB processes.  And I’m not going to re-hash all of it here but I did want to tell you about a use case that describes perfectly what I was talking about.

Not so long ago I got a call from one team and they told me that they had some server issues.  Everything moving slow they said.  Ok, so I got on and took a look and nothing was really jumping out at me.  Then I put a profiler trace on it to see if anything jumped out at me.  And of course, I knew nothing about the app or the processes so I really didn’t know what I was looking for, but you’ve gotta start somewhere huh?

So there I am in profiler and I’m just looking for long-running queries.  The problem is there were lots of queries I would consider long-running.  For some reason I focused in on a single SP that was taking like 5mins.  I pulled up the text of the SP and started looking through it.  It all seemed fairly standard.  I mean, it was long and everything wasn’t perfect, but there was nothing out of the ordinary. 

I contacted the app guy again and asked about it.  Does this SP typically take this long to run?  No, he says (and those of you who have seen My Cousin Vinny know where this is going).  So I thought eureka, I actually found something that may fix the issue.  So I got a couple valid params from him and ran the SP with them.  I also made sure to turn on execution plans and statistics io.  The query plan had some dings in it that experience has told me could easily have caused this kind of spike in resource usage.  The problem is that there was no fragmentation, and stats were up to date.  And in talking with the app guy he told me that they just archived a bunch of the data so it was down to like 200mill rows now.  So why would this thing be taking so long to return?  Moving on.

I found a copy of his QA system that had been copied over from prod the previous week and he assured me that they had changed nothing.  I could see the extra rows in the tables (copied before the archival), and the indexes were the same as in prod so that wasn’t the issue.  They had the same fill factor, everything.  In fact, everything I checked was identical except for the amount of data.  So why would having less data cause such a huge performance issue?  Moving on.

I decided that running this thing again and again on prod was probably a bad idea.  I’m just adding to the issue.  So I started doing the rest of my work on his QA box where I was the only spid.  And the hardware was similar as well (I love it when it works out that way).  So I ran the SP on this box and 5mins passed.  Then 10mins.  Then 15mins.  Then 20mins.  And sometime soon after that, the query returned.  I had collected all my stats along the way so I was golden.  It was getting the same execution plan as the prod version.  The results aren’t what I expected at all.  Why is the prod version now performing well in comparison?  So I called the app guy again and explained the situation.  Here’s more or less how the conversation went:

Me:  You know, I just don’t know what’s going on here.  I’ve been looking at this for a long time now and I’m getting further into a hole.  The prod version of this SP takes 5mins, and that’s even after the archival.  But when I run it on QA with all the data there it takes even longer.  If the prod query is acting up then I would expect the QA query to be a shorter time even with the extra data.

Guy:  Yeah that sounds about right to me.

Me:  What sounds right to you?  (I just got a bad feeling that something horrible had gone wrong)  (You know how you can instantly drop all the pieces into place and remember key words that make everything all of a sudden fit together?  Well, I just got that, but I wanted to hear him say it.)

Guy:  This SP usually takes about that much time, but since the archival it went down to 5mins.  We’ve been very pleased.

Me:  So you mean to tell me that when I came to you with this you didn’t find it necessary to tell me that the 5mins was an improvement?

Guy:  Well, I don’t know anything about DBs so I figured you could see that kinda thing already.

Me:  I see.  Well that clears up that mystery.  Now I’ve gotta go back and start over with this whole process.

Guy:  Well I can tell you the one that’s probably causing the issue.

Me:  Oh yeah?  How’s that?

Guy:  Because the slowness is only in our billing section and that’s controlled by just a few queries.  I can give you the names of the SPs and you can look at those.  There are only like 5 of them and since we’re having a hard time pulling up a list of clients it’s likely going to be the one that controls the search on that.

Me:  I see.  So you were just never going to tell me that?  I’ve been messing with this for 2hrs and you could have given me all this info before and saved me tons of time.

Guy:  Well, again, I don’t know anything about DBs and I figured you could see all that.

Me:  You thought I could see the web app from the DB?

Guy:  You can’t?

Me:  Kill me.

So ok, it turned out to be one of the 5 he gave me.  It had a bad query plan.  I wasn’t able to determine that all on my own, btw.  I had to recompile each one of them until I found the bad one.  And that’s because I didn’t have a perf baseline like I discussed on Marklar.

So there are a couple lessons to learn here but I think you can gleen them for yourself.  The whole point of this though is that making assumptions about processes is bad and no matter what looks like a long-running query to you, it may in fact be performing better than usual.

Post-install FUN!

This’ll be a quick one, but I just wanted to throw you guys another useful script real quick.  Now, whether or not you decide to make this work in PS or not is up to you.  Most of my post-install stuff is  still in T-SQL so that’s how I’m giving this to you.  Anyway, it’s something that gets overlooked quite often so I thought I’d just throw it up here real quick.

There are 2 things I like to do right away when I install SQL.  One is to set the job history max rows and the max rows per job, and the other is to set the number of error logs SQL will keep before deleting them. 

So this first one configs the job logging.  I like to keep a lot of logs for my jobs.  I’ve found that more often than not the default setting isn’t adequate if you want a real picture of what’s happening with your jobs.  So I increase it right off the bat.

 USE [msdb]
GO
EXEC msdb.dbo.sp_set_sqlagent_properties @jobhistory_max_rows=100000,
      
@jobhistory_max_rows_per_job=10000
GO

 

This 2nd script is what I use to set how many of the logs get stored.  Of course, you could also use a simple PS script to save the logs off to a different folder so you have them on hand if you like, but that’s up to you.

USE [master]
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'NumErrorLogs', REG_DWORD, 30
GO

The thing I really like about both of these scripts is that they work on SQL2K and up.  I’ve tested these all the way up to R2 and they’re both just fine.  So if you don’t have some standardized setup scripts you run on all your boxes when you install them, then let these be your first.  The more things are the same in your shop the easier it’ll be to admin things.  You’ll know what’s happening on your boxes and you have fewer things to remember.  And scripting becomes much easier too because if things run the same way and are named the same thing, then you know exactly what to look for in your scripts. 

Have fun.

The mini heart attack

Tell me if this scenario isn’t all too familiar.  You get a call in the middle of the night saying that something’s wrong with a SQL box.  It won’t respond at all.  Now, you’re the first one on the scene because we all know that if there’s a SQL box anywhere within 100 mils of the app, they’ll call the DBA first because it has to be the DB.  So anyway, you have plenty of time to think while you’re on the way to the scene. 

That first step is the hardest.  You throw the covers off of you and expose your warm body to the cold night air. 

You swing your feet on the floor and try to find something that’s not gonna be too hot or too cold because you have no idea how long you’ll be up.  At this point you’re still grumbling about how wordy the helpdesk guy was when he called.  Why can’t these guys ever realize that we’re asleep and all we need is essential info?

Now you’re on your way down the hall and your thoughts turn to the problem at hand.  What could it be?  Did someone turn off the service?  Did CHECKDB take too long and is blocking everyone? 

You just hit your desk and start logging in.  While you’re waiting for desktop to come up it hits you… what are the state of the backups?  Am I sure that I can recover this box should something happen?  What if this server’s down for good?  Oh CRAP, is this the box I got the alerts about the failed log backups yesterday and just ignored them?  I’ll be lucky if the log just filled up and I can do something about it, but if the box is down and I lost all at that data because I didn’t feel like messing with it I’m in trouble. 

So you login and take a look at the server.  You’re able to TS in without any trouble and you breathe a small sigh of relief.  Well, at least the box itself isn’t down.  I can fix almost anything else that may be wrong.  You instantly look at your backup jobs to see if something has failed.  You see nothing out of the ordinary.

Next you look to see if anything’s blocking.  Nope, you see nothing of the kind.

You can query the DB and it’s online so now your heart attach is completely gone and you turn your thoughts to what could actually be wront.  So you call the person who submitted the ticket to begin with.  She reports that they couldn’t get in to the DB for a few mins but that all seems fine now.  You tie up some loose ends on the phone and end the call.

You then close the lid on your box and as you walk back to bed you make a promise to yourself that you’ll never ignore another log backup alert ever again. 

Don’t let this happen to you.  Laziness is no excuse for not having a backup and answering the alert is much easier than answering your boss’s call about why you lost half a day of data.  Don’t you have alerts setup?  Then why did this happen?  That’s a tough question to answer. 

The point of all this is that things can go wrong on a moment’s notice.  Restoring your DB is like a car wreck.  It can happen at any time and you won’t have any notice.  So if you’re not sure… and I mean SURE about the state of your backups, then get that way.  Do whatever it takes to make sure you’re covered and you know it.  And that includes doing the actual restore.  Do you know exactly what it’ll take to restore your server?  The last thing you want to do is to have to figure out what has to be done when you’re under the gun.  So unless you know exactly what it’ll take to restore something then you don’t have a solid plan.  So avoid the bread lines and these mini heart attacks and do your diligence.  The life you save may be your own.

Dealing with stupid customers

As we found out yesterday there’s more that one way to deal with a customer you think is stupid.  And now matter how good or bad Cornhole was is irrelevant because he still had a customer he thought was stupid.  So whether you’re right or not isn’t important.  The bread lines are full of guys who were right.  So that’s evidently not what’ll keep you your job.  Good customer service is what’ll keep you your job.  And it’s not always easy to keep your temper in check.

I expect very little of my customers.  I know that most people know almost nothing about DBs so I don’t mind when they say something wrong, or when they ask what’s thought of as a stupid question.  What bothers me though is when they claim to not know anything about DBs but they don’t believe you when you answer their questions.  No, that doesn’t sound right to me.  This is a dangerous crossroad because your next statement can determine whether you go back to your desk after the meeting, or to HR.  Typically, what I do when they don’t believe something I say is I ask them what it is about it they’re having a hard time with.  So instead of getting into a pissing contest, just find out what they don’t like.  This way you can attack their problems one by one until they have no choice but to believe you.  I say that, but we all know those customers who refuse no matter what you say.  But by attacking their issues one by one you will quite often find that they didn’t understand what you were saying so they rejected it on the Big-Word Factor.  The Big-Word Factor has 2 sides and you never know which one it’s going to land on.  The first side is what we just discussed;  people discredit what you say because they don’t understand the big word you used.  And anything they haven’t heard of couldn’t possibly work.  The other side of that can do just as much damage.  This is when someone is so impressed with your big words that they blindly follow whatever you say.  I’ve seen this cause quite a few problems because a customer likes the sound of a word and it just gets them into trouble.  Clustering is one of those words.  More people implement clustering because it sounds cool and they don’t get what they really need.

So what do you do if the customer just insists that you don’t know what you’re doing?  Well at some point you’ve just gotta say, well it’s too bad you don’t understand what I’m talking about, but this is what we’re doing because I’m the DBA and you said you didn’t know anything about it.  So why would we do what you think is smart when you claim to have no knowledge on the topic and I do?  There’s a reason you let the brain surgeon (and not your husband or your kids) operate on your mother.  And I bet you don’t understand all the words they say either do you?  And a lot of people don’t realize this, but a really good IT guy studies just as much if not ultimately more than most doctors.  And we can experiment without any kinds of moral issues getting involved.

Is teamwork really that rare?

Well, despite the saga today that you can read about in my other 2 posts (Why can’t voodoo be real? and The stupid have fallen), the day ended fairly well in my last meeting.  I’ll give you just a snippet of the backstory before getting into the meeting.

We do a lot of server builds.  And quite a few of them are clusters.  So the problem is that we’re expecting to be given a server in a certain state and we don’t always get it.  So sometimes we have to troubleshoot something ourselves to get the server to look like we’re expecting.  And of course other times it’s just what it should be.  So we had a meeting today with the DBAs, server guys, and SAN dudes and all of our directors to try to sort this out.

That said, I’ll just give you the end result so I can get on to the rest of the post.  What we decided to do is next time we have a cluster build we’re all going to sit in the same room and do our thing and we’re going to negotiate what each hand-off is going to look like.  So the server team is going to build a checklist based off of what we agree on and every server they provide us will look exactly like that.  And we’ll know exactly what’s expected of us, and so will the SAN dudes.  Personally I can’t wait, because that’s such an excellently low-tech way to solve a problem.

Now, this isn’t exactly a rant, but kinda.  Is that level of teamwork really that rare?  I can tell you that in my experience is certainly is.  In almost every company I’ve been in the different groups have been at such odds they could barely communicate.  They honestly forget that they’re all on the same team working towards a common goal.  My last job was the worst about that.  The ETL team manager made sure his team was at odds with everyone and they kept everything to themselves and never even discussed issues in a friendly manner.  It was very acrimonious and tense whenever the different groups would get together for meetings.  And I’ve been in several shops that distrusted each other like that. 

In fact, I actually sat in that meeting today and said out loud what a strange feeling it was to actualy work openly with another team like that.  And it really is.  Everything my team does is an open book.  I’ve gone out of my way to make sure my team doesn’t hide anything from anybody because we’ve got nothing to hide and we’ll make more friends if they know why we’re doing certain things.  So our reasons for doing something and what we’ve done are always an open book… even our mistakes.  We admit to them and tell the customer what we’re doing to fix it and how long it will take.  And I’m not saying that I’m the reason these other teams are playing nicely, but I’m certainly fitting into this portion of the environment for sure.  And I can’t say that all teams play this well together, but I know a lot of them do because I’ve witnessed it. 

I’ve actually been saying it for years… Let’s pretend we’re all in the same company!

The stupid have fallen

This is a followup to my previous post here.

Wow, what a day.  Ok, so I just got off the phone with the tech lead for that company.  It was enlightening to say the least.  It was really a longer call than I expected or that I even wanted, but my blood pressure’s gone down a bit now.  I obviously can’t recount the entire conversation for you, but here are the highlights:

V = Vendor

M = Me

V: Hi Sean, this is Josh(not his real name) with X and I was told you wanted to talk to me.

M: No, the last thing in the world I wanna do is talk to you, but I feel in order to get our issue resolved I have no choice.

V: Yeah, Cornhole(not his real name) told me you got upset with him when he was just trying to explain to you what your issue was and then you insisted on speaking with me.

M: This is just incredible.  No I didn’t get upset with him for explaining the issue to me.  I got upset with him when I told him his explanation was flatout wrong and then he called me an idiot.  He didn’t even hint at it.  He called me an idiot outright.

V: Really?  Cause that’s not the story I got at all.  I heard that he was calmly explaining that your backups were the issue and you just exploded on him.

M: No, that’s NOT what happened at all.  That little turd actually called me stupid for not buying his assinine explanation for our issue and then I only exploded after he did that a couple times.

V:  Well what don’t you believe about it then?  Because we’ve seen that many times where backups will cause proceses to block.

M: No you haven’t.  Listen, I realize that everyone can’t spend their days studying SQL, but one simple fact is that backups don’t block processes.  Period.  I’ve been doing nothing but DBs in SQL Server for over 15yrs against TBs of data and nowhere have I ever seen a backup block a process.  The problem is that you’ve got like 3 tables with TABLOCK in that sp and that’s what causing your blocking.  Don’t you think it’s funny that it only clears up AFTER you kill that process?

V: Where did you get the code?  Those sps are encrypted.

M: Encryption only stops amateurs.  And while we’re at it, what’s this script I hear about that you’ve got to unconfuse SQL to give you the real spid for the process?

V: Where did you hear that backups don’t block processes?  It’s well-known here that it’s one of our biggest problems.

M: No, your biggest problem is your TABLOCKS.  And I heard it from the truth. 

V: What is a tablock?

M: A table-level lock.  You’re locking the entire table just to read data.

V: I don’t know about that, I’ve never seen the code because it’s encrypted.

M: Well I do and that’s your problem.  Now what about this script I kept hearing about from Cornhole?

M: Did you get my email?

V: Yeah.

M: And you can see the place in the code where you’re locking the whole table?

V: Yeah.

M: So how is it that you lock the entire table and you claim that it’s the backup blocking everything?  Haven’t you noticed that the backup only decides to block stuff when this process is running?

V: That does sound a little suspicious when you put it that way.  What can we do?

M: Let me take those TABLOCKs out of there so I can query these tables without locking everything up.

V: I just saw your email signature and I’ve never heard of an MVP before, but I just looked it up.  Are you really one of those guys?

M: Yeah.

V: Wow, so I guess you really know what you’re doing then.

M: I’ve hung a few DBs in my day, sure.

V: Do you mind if I write you again if I have any questions?

M: I suppose that depends on whether you’ll let me change that stupid sp or not.

V: Yeah, go ahead.  I’ll have to have a talk with our devs tomorrow and try to convince them to put this in our next build.  Honestly, I’m only a tech lead here because I’ve been here a few months longer than anyone else on the support team.  We get all this stuff from the devs and they won’t tell us anything.

M: So what about this script I keep hearing about.  The one that tells you how to unconfuse SQL and give you the right spid for a process?

V: That’s a script the devs have and they won’t show it to me either.  I just tell my guys something else so they won’t know I haven’t seen it.

M: Wow, that sucks man.  You do know though that a script like that doesn’t exist, right?  It’s completely bullshit.

V: Yeah, I hate this place.  I’ve been suspecting for a while now they they were lying to me, but what can I do?  I need this job.  I’m just lucky to be working.  I have no idea what I’m doing here.

M: I don’t know what to say to that.  You’re right, you are lucky to be working these days.  But pick up a couple books on your own and learn SQL.  Don’t rely on them.  There are websites, blogs, etc.  I myself run a site.

So in short, I really started to feel for this guy.  He ended the call apologizing 100x for the grief they’ve caused me and he’s going to go out right away and start watching my vids and trying to learn more.  He asked if he could write me with questions, and I said, of course dude, anytime.  That’s what I do.

And y, he sounded about 22 as well.  Turns out I was right.  I asked and he was 21 and this was only his 2nd job and they brought him in from nothing and “trained” him.  I’d say he’s got some work to do.  But I personally consider this exchange a success.