WHOOOP!

PASS, SQL Server, T-SQL
I just got the good word, I submitted an abstract for a spotlight session at the PASS Summit and it was accepted. Jazzed doesn't begin to describe it. If you're interested in hearing what I think about Best Practices for working with Execution Plans, please swing by.
Read More

Odd TSQL Behavior

SQL Server, T-SQL
Before I describe this, let me thank Lynn Pettis over at SQL Server Central for coming up with the answer. This morning a developer walked up and asked me what would happen if he ran a query that looked like this: SELECT 1.SomeString I said that he'd get an error. No, he says, try it. So I try it and I get this: Somestring 1 Try it yourself. It works just fine. I'd never seen that before and didn't have a clue what it was. Thinking that Microsoft had supplied some new short hand to define aliases I ran this: SELECT 'dude'.dudette Which resulted in the error:   Msg 258, Level 15, State 1, Line 1 Cannot call methods on varchar.   Which is what I would have expected. I…
Read More

Powershell Blog Worth Reading

PowerShell
I don't usually make a big deal about my blog roll. I usually add either people I read regularly or people who ask to be added. I don't have a hierarchy of belonging & all that (yet). But I want to point out one that I just recently put up. Chad Miller, creator of SQL Server PowerShell Extension, blogs about SQL Server & PowerShell. If you're not already reading his stuff, you should. Unlike me, he really knows what he's talking about.
Read More

More PowerShell Basics

PowerShell
Because of the data center move, we have a number of different functions that we're running on totally different sets of servers on different days. None of this is part of our normal maintenance routines, so I've been using it as a great opportunity to stretch a little with PowerShell. I'm still learning, a lot. The latest task was to get the databases of a list of servers backed up. I initially tried it using SMO. It works great. But it's serial across all the servers as well as across the databases. I'm fine with serial backups on the databases (very, very fine, I saw a parallel backup of all databases once, pretty sparks, like the Fourth of July) but I really wanted all the servers to get backed up…
Read More

PowerShell Basics

PowerShell
I'm just learning how to use PowerShell. I've been trying to spend time with it over the last year, ever since I saw Allen White's presentations at the PASS Summit last year. I just haven't had the time. But recently, my company has been performing a multi-phased data center move. Because of it, I've needed to run tests & updates, disable jobs, all kinds of things on different sets of servers on different days. To paraphrase the old Superman cartoons "This looks like a job <voice gets deeper> for PowerShell." I'm not even remotely qualified to begin teaching anyone PowerShell. I had problems recently getting an IF conditional statement to work correctly. However, in the interest of sharing, in case you're thinking about picking it up (do) or you're actively…
Read More

Help Make Connect Work Better

Misc
I've posted several times about how useful I find Microsoft Connect. I've seen issues introduced there get resolved through hot fixes and service packs. I sincerely believe it's a very important tool in your arsenal to get the kind of service you need from Microsoft. Here's a post on Connect that's trying to make Connect itself easier to use. I'd strongly recommend you swing by and vote positively for this. And for those who are unclear, click on the stars to submit your vote.
Read More

Database Screening Questions

SQL Server, T-SQL
With all the cool kids posting about beginners and interview questions, I thought I'd toss my favorites out there, from the brief-case gang point of view. These are the technical phone-screening questions I use after I look at a resume. There are only 10. They're simple. Stupid simple. Silly even. Yet, I can count on eliminating 4 out 5 people who have a resume that looks like a qualified DBA. I've seen people with 10 years experience fail on these questions. I'm only going to provide the questions. If you can't find the answers on your own, you're already disqualified: What is the difference between a clustered and non-clustered index? No, don't tell me that one is clustered and the other is not. I don't need specific low-level information on this, just…
Read More

Tim Ford’s Top 5 Indexing Best Practices

SQL Server, T-SQL
All I can really add to this is, yeah, me too. If you want some absolutely great advice on indexes, read this post. It's a must. And might I add, I've been the bad guy in Tim's example. Once, many, many years ago, I was reading from the SQL Server 7.0 documentation. It suggested that compound indexes were no longer needed since the optimizer could build them on the fly using index intersection. I had a performance problem and a consultant was telling me to use a compound index. I swore up and down it wouldn't work because Microsoft said so. He kept pushing and I kept pushing back. Finally, after a rather heated discussion in which I was convinced I had the upper hand, I got off the phone…
Read More

Unpacking the View

SQL Server, T-SQL
A view is simply a query that behaves something like a table. Most people know this. Most people also know that a view is simply a mask on top of what might be a very complex query. It all seems really simple. You call the view inside a simple query, the view runs the underlying complex query. Most people might not know that when a view is called and it gets sent to the optimizer, the optimizer unpacks the view and binds the component parts of the query necessary to create an execution plan that will return the data requested. What I didn't know until recently was that the optimizer is VERY smart. Not only does it unpack the query of the view, but it will change the query that…
Read More