It Is Your Fault

Professional Development
I earned my nickname. I'm proud of it. I am the Scary DBA. I don't really like to advertise my other nickname, Rant (get it, Grant shortened to another word). I earned that one too. I'm not proud of it at all. I got that one because I sometimes don't listen as much as I should and, because I tend to be more than a little passionate about my job and my databases, I would go off on a rant. And yeah, I stood in the way of some development processes and approaches that I shouldn't have. Instead of facilitating the development team and trying to understand their problems and issues, I just said "No." Usually at length. I just finished reading this post from Martin Fowler, whose work I've  enjoyed,…
Read More

SQL Saturday #187 Richmond And More

Professional Development, Redgate Software
In just a couple of weeks I'll be flying down to Richmond, VA to speak at SQL Saturday #187. I'll be presenting two topics, Backups for the Accidental DBA and Query Tuning in the Clouds. It's going to be a great event with a bunch of excellent speakers. If you're in the area, come on down and say hello. And, if you have some time on Friday before the event, Red Gate Software is hosting a special 1/2 day seminar targeting the database professional just getting started with their career. There are only a few seats left, so if you're interested, sign up quick. Steve Jones and I will be presenting on several topics from monitoring to backups, database corruption and indexing. It'll be great way to learn, network, see…
Read More

SQL Server Naming Standards

T-SQL
Want to start a fight between a bunch of DBAs or database developers? Ask them where the comma should be placed between columns in a SELECT statement. It's actually a little disturbing just how much emotional value people place in this. Almost as good, tell a database developer you don't like their naming standard. Hoo boy! The purpose of a naming standard, I think most of us can agree, is for clarity. We're defining language so that we all mean the same thing when we say it, right? We want to communicate clearly, so we're going to implement a naming standard. Fine. Sounds good. And then, you get this: dbo.tblDdltbl Umm... Wait. What? And there are hundreds of these, all with the same first three letters, tbl. Oh, wait, I…
Read More

DBAs and the Dark Closet

Professional Development
For many years, I loved being a DBA because, unlike being a developer, I could sort of hide from the world. I could go into a dark closet (a well-lit cube, but hang with me here) and hide from everyone (except the people in the cubes next to me, my boss, the teams I supported, the people I passed on the way to the toilet, others) and just be a hermit (except for the daily stand-ups, weekly status meetings, occasional training) and only ever talk to people when things went wrong at 3AM (or at 2PM when the CIO and a bunch of other managers would be standing in my desk). As long as I did my job well, maintaining the backups, running maintenance, and setting appropriate security settings, I…
Read More

New DMO in Azure SQL Database: sys.dm_db_wait_stats

Azure
I just did a series of Boogle searches and when that didn't find anything I tried Ging. Neither listed sys.dm_db_wait_stats. Nothing in a search directly against MSDN either. So, let me introduce you to a new DMO, sys.dm_db_wait_stats. It's a dynamic management view since it doesn't require any input. The output is about what you would expect if you thought about it for a second:   In short, what we have is the sys.dm_os_wait_stats moved internally into your SQL Database so, even though you cannot get at any of the OS counters from with an a SQL Database normally. In short, thanks Microsoft. Now we can see the wait statistics on our Azure SQL Database in order to better understand where things are problematic. Without documentation I don't know for…
Read More

Azure SQL Database Execution Plan Differences

Azure, T-SQL
I've been exploring execution plans in Azure SQL Databases a lot lately. I'm getting a presentation together for  some upcoming SQL Saturday events (first one is SQL Saturday #177, Silicon Valley). If you scroll to the bottom of this previous post, I mentioned that there were clearly differences in the optimizer because queries against empty databases were generating different plans. I've loaded up the data in my database, both SQL Server and SQL Database, so I can compare real behaviors. Doing so, I found a fun difference, even though I was running the query and generating the plan from SQL Server Management Studio. Here's the property sheet from the SELECT operator for the query run against SQL Server: And here's the property sheet from the SELECT operator for the query…
Read More

Saving Execution Plans on Azure SQL Database

Azure
In my previous post showing how to get to execution plans in the Database Management Portal, I showed that it's pretty easy to put a query in a query window and get the execution plan. This allows you to understand query behavior in order to tune your T-SQL or your data structures, all through the Azure interface. But, what happens if you want to share an execution plan with a friend, post it to an online forum, save it for later comparisons as part of troubleshooting bad parameter sniffing, track behaviors over time as statistics change, other purposes that I can't think of at the moment? To first answer this question, let me tell you how you would do these things in SQL Server Management Studio (SSMS). First, and most…
Read More

Pro SQL Server 2012 Practices: Chapter 12

Azure
I was very privileged to get the opportunity to write a chapter in a book with some of my friends and SQL Family, Pro SQL Server 2012 Practices . Just as each of us took a chapter to write, each of us going to take a chapter to review. But, being the greedy sort, I'm going to review two. First up, Chapter 12, "Windows Azure SQL Database for DBAs", by Herve Roggero (b|t) Personally, I love Azure. And I love Azure SQL Databases. But, I get the fear and trepidation they might cause. I also get the urge to write about them, but I never really felt like I should approach them from a book. Everything changes so much, so quickly in Azure and books just take a while to…
Read More

You Can Say “No”

Misc
I heard about this new law that was passed to prevent employers from asking for your social media passwords. After the laughter stopped, I realized that, maybe, this would be needed. Not because I need the government to help me manage my interactions with my employers and potential employers. And not because I think the government needs to be involved in other peoples interactions, not at this level. But because I don't think people realize they have a word that they can use with employers. That word is 'No.' "We want you to sign this non-compete agreement that says you'll never be a DBA for any other company after leaving ours." Ha! No. And yes, I really had one of these. And yes, there actually are laws against it (I…
Read More

Execution Plans on Azure SQL Database Portal

Azure
If you've been working with the Azure SQL Database portal, you know that you have a query window. Within the query window you can run queries against your server. You'll get back results, timing, everything you need to observe behavior within the system. What's that? You never heard of this? Let's figure it out real quick. Here's my portal to my Azure SQL Databases: [caption id="attachment_2296" align="alignnone" width="150"] Azure SQL Database Portal showing usage overview[/caption] Yes, all sorts of things you can do from here, but we're focused on the bottom of the screen at the Manage button. Clicking this button will open up the Management portal window, part of which you can see below: [caption id="attachment_2298" align="alignnone" width="150"] Part of the Azure SQL Management Portal showing some of what…
Read More