12 Days of SQL, On the 2nd Day of SQL…

PowerShell
Microsoft gave to me, an excellent new management language. Yeah, so it doesn't rhyme or match the song in any way, but as far as gifts of the season go, PowerShell is it. There are a couple of problems with PowerShell, first, it's not installed everywhere, and second, DBAs just haven't quite latched on to this new language as a management tool. That second problem is absolutely not one that I would say about Aaron Nelson (blog|twitter), our next 12 Days of SQL blogger.  Aaron is one of the leading lights out there educating DBAs, and everyone else for that matter, about the strengths and capabilities of PowerShell as a management language for SQL Server. I've said it twice, and I hope you noticed, but I didn't say scripting language,…
Read More

SQL Saturday New England, #71

PASS
I've finally got everything together to get the web site going for SQL Saturday #71. The call for speakers is open. We're open for registrations. I'll be contacting sponsors shortly (or you can always contact me). In short, SQL Saturday #71, New England Data Camp #3, is a go!
Read More

So you want to write a book

Misc
I had posted a while back on the process of book writing. It was an attempt to educate while scaring you half to death. Writing a book is extremely hard work, especially when you try to do it while holding down a full-time job and maintaining something resembling a life. Enough scare tactics though. My Apress editor, Jonathan Gennick, great guy, wrote a detailed overview of how to put together your book proposal. The overview is targeted at Apress, but that’s largely a question of formatting. The gist of the article, and the wisdom and excellent information within it, are going to be applicable to any & all publishers. Some of the stuff that really jumped out at me: You’re writing the proposal not only to sell the book idea,…
Read More

Review: Idera SQL Doctor

SQL Server, T-SQL, Tools
Recently, a co-worker practically slammed me up against the wall, exclaiming “You have to check out this new tool, right now!” The piece of software he was so excited about was Idera’s SQL Doctor. Based on this assaultrecommendation, I decided to take a little time & look the software over. SQL Doctor, as the name implies, is a diagnostic tool. It runs a set of best practice rules against your server, your databases and your code. As the rules are executed, your system’s compliance with these best practices is evaluated and an interactive report is generated. With the report you can drill down on various aspects of your system to see where you may have gone wrong. All that sounds very clinical, just laid out like that. But the fact…
Read More

SQL Spackle

SQL Server, T-SQL, Tools
I previously mentioned how SQL Server Central was listing ideas for articles, primarily for short, quick, pointed articles that they were terming SQL Spackle. Spackle is a term in the US that represents the filler you put into dry-wall to smooth it out or fix small holes, so SQL Spackle is meant to fix small gaps in knowledge or documentation. My first SQL Spackle article was published today. I kind of forgot it was coming. I wrote a quick and pointed outline of how to set up and schedule a server-side trace. This is something I've always advocated, and now I can point to a bit of spackle to fill in the gaps for those who don't know how to get it done.
Read More

Regressions

SQL Server
[caption id="" align="alignleft" width="244" caption="Hannah Dustin, Upset about Regression"][/caption] One of the most important take-aways from David Dewitt's presentation at the PASS Summit was the level of fear within the Query Processing team at Microsoft caused by regressions. If you missed Dr. Dewitt's presentation, I tried to capture as much of it as I could here, and it will be available within the DVDs from PASS. Regression is when something moves backwards to a less perfect state. When talking about the optimizer in SQL Server, a regression is when you see a query that used to run fast in SQL Server 2000 or 2005 and suddenly after upgrading to 2005 or 2008, the exact same query now generates a different execution plan and runs slowly. Now do you know why…
Read More

FreeCon

Misc
I got my FreeCon. What's more, I did it in public and didn't get in trouble. FreeCon is the brain child of Brent Ozar (blog|twitter). Basically Brent gathered together a few bloggers & writers from the SQL Server community, some extremely well known, like Tom LaRock (blog|twitter), some in the middle, like me, and others that are clearly up & coming like David Stein (blog|twitter).  He jammed us all in a room and made us talk to one another. OK, that's a lie. He invited us out to this lovely little poetry space in Seattle the day before the PASS Summit was due to start, where we imbibed good food & coffee and had the opportunity to share a lot of great information with each other. The basic concept was…
Read More

Do Foreign Key Constraints Help Performance?

SQL Server, T-SQL
Most people are very aware of the fact that having a foreign key constraint in place on your tables adds overhead to inserts and deletes. And many people believe that there is no benefit to foreign keys beyond referential integrity (which, the application can handle perfectly well, right?). But is that an accurate statement? Here's the basis for our investigation, a query in AdventureWorks2008R2: SELECT p.LastName + ', ' + p.FirstName AS 'PersonName' FROM Person.Address AS a JOIN Person.BusinessEntityAddress AS bea ON a.AddressID = bea.AddressID JOIN Person.BusinessEntity AS be ON bea.BusinessEntityID = be.BusinessEntityID JOIN Person.Person AS p ON be.BusinessEntityID = p.BusinessEntityID; This query results in the following execution plan: I know that is an ugly query and an ugly query plan, but bear with me for a moment. Do you…
Read More

Un-SQL Friday: Branding?

Misc
Following in Midnight DBA's more interesting half new blog fest topic. My branding? I don't have a clue. There, I said it. Up until very, very recently, I've just been doing stuff. I haven't really even tried to think about what the plan was. Write a book? Sure, sounds like a cool challenge. Write another one? Well, the last one didn't kill me, OK. Start a blog. Jump on Twitter. Pick a Name. Could I pretty please present at PASS? I've been very focused on building my name, but I honestly never thought about my brand. It's just not something that occurred to me. Yes, I am that slow. Now recently, stuff has been happening and I'm suddenly concerned about it. I too went through FreeCon with Brent Ozar (blog|twitter).…
Read More

Reason for Early Termination of Statement

SQL Server, T-SQL
Wouldn't you like to know why the optimizer stopped tuning the execution plan you're looking at? It's actually possible and simple to get this information. I talked about this a little more than a year ago, but I left out some information that might be useful. Let's take a very simple query: SELECT * FROM Person.Address AS a; This generates a simple execution plan, in fact a trivial plan: I know that this is a trivial plan one of two ways. The hard way is to look at the XML (BTW, this is the type of thing you can't see it in STATISTICS PROFILE, which I understand a lot of people are using). Right at the top is the SELECT element. You can see the value for StatementOptmLevel property is…
Read More