Coming to Your Town

PASS, Professional Development
I can't sing and I can't play and I left the young generation behind a while ago, but I'm still coming to your town, or maybe one near you. Between August and December I'm hitting a substantial portion of the country, so if you want to have a little fun, discuss SQL Server, network, or just chat, here are your chances. Please, ask me questions. Please, walk right up and say hello because we can learn from each other and I love my SQL Family. Here's where I'm going to be: SQL Saturday #125 in Oklahoma City, August 25: Only one presentation here, Top Tips for T-SQL Performance, but it's a fun presentation. Register now because time is running out. SQL Saturday #156 in Providence, RI, September 15: This is…
Read More

Being Right, the Other Side

Professional Development
I read an excellent article by Camille Fournier about the importance of recognizing that being right is not the only factor that needs to be taken into consideration when making a decision. You could even change it from "being" right to "doing" right. Although, I mean it in a technical sense, not a moral one. If you haven't read it already, go ahead, I'll wait... I agree with her. I've been that guy... more than once.... okay, okay, a bunch of times. You know that guy. The one who just couldn't see past the point that we were doing something wrong, something stupid, something that would bite us in the butt for the next three or four years. Oh yeah, that guy. The popular one (not at all). The one…
Read More

Execution Plans … In the Cloud!

Azure, T-SQL
If you’re moving to a fully-fledged SQL database as part of Azure you may never even touch SQL Server Management Studio (SSMS). Instead you may do all the management of your SQL database through the Management Portal. You can actually do everything you need to through this tool. This includes writing and testing T-SQL statements. Believe it or not, it includes execution plans. But, if you’re used to seeing this from a query: Then you may be a little bit surprised at this: Believe it or not, those are identical plans. Yeah, the graphics are different, radically so. But the plans, those are the same. I have a small test database that I have loaded into my local server and onto my Azure SQL Server database. It has identical structures…
Read More

SQL In The City: London 2012, Recap

Professional Development, Redgate Software, T-SQL, Tools
Wow! How's that for a recap? The concept for the SQL in the City events is pretty simple. Put on a free event that instructs people on SQL Server, Azure, and related technologies along with a healthy smattering of Red Gate tools. All teaching is done by some of the best people in the business (and me). This was the second event in London. The concept was launched there last year and succeeded quite well. This year the event filled it's registrations so quickly that Red Gate felt obligated to have a second day, which almost completely filled up too. There were more than 350 people in attendance on Friday, and then, on Saturday, a day off, another 250+ people showed up. That's well over 600 attendees over the two…
Read More

Querying Information from the Plan Cache, Simplified

SQL Server, T-SQL
One of the great things about the Dynamic Management Objects (DMOs) that expose the information in plan cache is that, by their very nature, they can be queried. The plans exposed are in XML format, so you can run XQuery against them to pull out interesting information. For example, what if you wanted to see all the plans in cache that had a Timeout as the reason for early termination from the optimizer? It’d be great way to see which of your plans were less than reliable. You could so like this: WITH XMLNAMESPACES(DEFAULT N'http://schemas.microsoft.com/sqlserver/2004/07/showplan'), QueryPlans AS ( SELECT RelOp.pln.value(N'@StatementOptmEarlyAbortReason', N'varchar(50)') AS TerminationReason, RelOp.pln.value(N'@StatementOptmLevel', N'varchar(50)') AS OptimizationLevel, --dest.text, SUBSTRING(dest.text, (deqs.statement_start_offset / 2) + 1, (deqs.statement_end_offset - deqs.statement_start_offset) / 2 + 1) AS StatementText, deqp.query_plan, deqp.dbid, deqs.execution_count, deqs.total_elapsed_time, deqs.total_logical_reads, deqs.total_logical_writes FROM…
Read More

The New Phone Book Is Here!

PASS
I can't help it. I get really terribly excited when I publish a book. Maybe it should be old hat. Maybe I should be jaded. But I'm just a 12 year old (it's been argued 10) in reality so I get really, really jumping up & down excited when I get that wad of paper and my name is on the cover. It just doesn't seem to get old. What am I talking about? Oh, sorry. Let me explain. After about nine months of work, my new, revised edition, of the Query Performance Tuning book is available. I want to publicly, and loudly, thank Joe Sack(blog|twitter) for the incredible job he did as tech editor. His hard work, and ruthless criticism, made this book what it is. Despite the scar…
Read More

Problems with my new book

Professional Development, SQL Server
First off, I apologize. As if writing a book wasn't hard enough, now we get new problems because of on-demand printing. Here's the story. Book. Nine months of writing. Excellent technical editing. Great copy editing. Book complete about six weeks ago. Yay! Now things get fun... Here's how it works. Everyone these days uses digital copies of the book and prints on demand. So Apress is printing some copies of the book, but not all. They send a file out to places like Amazon. Amazon uses that file to print some copies of the book, as needed, on-demand. Everyone is, in theory, printing from the same digital file, creating exactly the same book. Or are they? What happens if, oh, let's just say that a file was corrupted somehow prior to…
Read More

Does Encryption Affect Seeing Statements in Deadlock Graphs?

Uncategorized
Good question. I don’t have a clue. So let’s set up a test. I’ll create this stored procedure: CREATE PROCEDURE DL2e WITH ENCRYPTION AS BEGIN TRANSACTION UPDATE Purchasing.PurchaseOrderDetail SET OrderQty = 2 WHERE ProductID = 448 AND PurchaseOrderID = 1255; Then I’ll execute things in the following order. From one connection this query: UPDATE Purchasing.PurchaseOrderHeader SET Freight = Freight * 0.9 --9% discount on shipping WHERE PurchaseOrderID = 1255; From a second connection, my stored procedure: EXEC dbo.dl2e; Then, back on the first connection, this query: UPDATE Purchasing.PurchaseOrderDetail SET OrderQty = 4 WHERE ProductID = 448 AND PurchaseOrderID = 1255; That will generate a deadlock. It’s a straight-forward classic deadlock. I’m using extended events to capture the deadlock graph and the output looks like this: <deadlock> <victim-list> <victimProcess id="process472310928" />…
Read More

PASS Summit 2012

PASS
I sure hope you’re planning on attending the PASS Summit this year. If you’re not, you might want to reconsider. They’ve just released the list of sessions. You should click this link and check them out. There’s going to be some magnificent instruction available in all aspects of SQL Server. You don’t want to miss it. On a personal note, I’m doing an all-day pre-conference seminar on query performance tuning. It’s called “Query Performance Tuning: Start to Finish.” The pre-con’s, as we call them, are an additional cost on top of the cost of the Summit itself. But you’re flying out to Seattle anyway. Why not attend a full day of learning, walk away with a little more knowledge under your belt. I’m going to give you as much information…
Read More

PASS Nomination Committee

PASS
For some reason, which isn’t completely clear to me, we’re voting for part of the members of the Nomination Committee who will work their buns off (make no mistake, this is not a glamor posting) to pick and choose from the people applying to be possible candidates for the PASS Board to arrive at a final slate. This voting opens today, although you can’t seem to vote from the web site, but have to wait for an email to show up (not yet in my Inbox). Regardless of the confusion I feel about this, I’m going to vote for the people I think will do a good job. You should too if you’re a member of PASS. I know almost every one of these people personally. Any of them will…
Read More