Azure Virtual Machines: Initial Thoughts

Last week was a weird one for me. For the first time in more than 25 years, I found myself unemployed. I was anticipating using my newfound abundance of free time to learn as much as I could while I continued searching for my next employment opportunity. But my plans got scuttled: as a Floridian, I found myself coping with the aftermath of hurricane Irma. I was fortunate to have no damage to my home. There was plenty of cleanup to be done around the house, however (mostly downed tree limbs). I was one of the lucky few that had power at home. Many local friends were not so lucky. Some of them came over for a hot shower, the glory of air conditioning, and a sympathetic ear. Schools were closed for the week and my young son was home.


Dipping My Toes In The Azure Pool

Dave Mason SQL Server Azure Blob Storage

I've known about SQL Server's ability to backup a database to Microsoft Azure Blob Storage for some time. But until recently, I'd never tried it. This seemed like one of the easier ways to start learning about Microsoft Azure, so I decided to give it a try.


Passing The Torch At The End Of The Road

Dave Mason SQL Server Documentation

This is my final week of employment with my current employer. I've decided to leave and begin my search for other opportunities. Now, as in the past, my final two weeks have been hectic. Numerous people have wanted my time for knowledge sharing in the hopes of having a smooth hand off to whoever ends up filling my shoes. Although my decision to leave came abruptly, I've been ready for the hand off for a long time. Let me explain.


A TSQL Developer Contemplates CHAR(82)

Dave Mason - R dplyr

I've been reading R Programming for Data Science and trying to make some sense of Big Data and how it fits into my world as a SQL Server professional. To be frank, it's been slow going. After three months, I'm not even halfway through the book, which isn't that long to begin with. In my defense, I have gone to three SQL Saturdays in that span, along with writing nine blog posts. I could have done worse.


Identifying Deprecated Feature Usage (Part 2)

Dave Mason - SQL Server Deprecation

In my previous post, I took a stab at monitoring deprecation events for SQL Server. It didn't go so well. A deprecation event occurred more than 5,000 times in a very short period of time, and I got one email for every occurrence. Not good. Here's what I kept seeing over and over:


Identifying Deprecated Feature Usage (Part 1)

Dave Mason - SQL Server Deprecation

I've wanted to do some Event Notification testing for SQL Server deprecation events for quite some time. The thought process here is that I could send myself an alert to identify usage of SQL Server features that will be removed from the next major version (or future version) of SQL Server. I could then forward this info to development and let them take action...or not (I kid, I kid). Today is the day I finally got around to the testing. I didn't get very far, though.


STOPAT And Date Formats


I recently had the need to restore a database with recovery to a point in time. I've only done this a few times, so I had to look up the syntax for stopping the last and final transaction log restore. Microsoft Docs shows us this "Basic Transact-SQL syntax":


There's nothing I see in the documentation regarding the format for "time". But there are a couple of examples, including this one:


Handling SQL Server Deadlocks With Event Notifications

Dave Mason - Event Notifications - SQL Server Deadlock

I've seen a few different methods for handling deadlocks in SQL Server. I don't notice the use of event notifications very often, so I thought I'd share my approach. For my purposes, I want SQL to notify me when a deadlock occurs. I also want an easily accessible deadlock graph that I can inspect and potentially pass along to development or software vendors.


Undocumented T-SQL Commands

I recently encountered code similar to this in production:

IF (NOT IS_MEMBER('db_accessadmin') = 1) AND
 (NOT IS_MEMBER('db_owner') = 1)
 DBCC AUDITEVENT (109, 1, 0, N'<loginName>', N'<dbUserName>', NULL, NULL, NULL, NULL, NULL)


Database Corruption: Incorrect PFS Free Space

Dave Mason - SQL Server - DBCC CHECKDB

I've been lucky with database corruption during my career. I could probably count on one hand the number of times I've had to deal with it. A couple times, it was in a customer's environment--they managed it themselves, but called me in to help. The other incidents were ones I inherited from a backup I had to restore into a production environment. The first time it happened to me, I didn't realize it until days later when DBCC CHECKDB ran during a weekend maintenance window. After that, I added a new "rule" to my list: always run DBCC CHECKDB after restoring a database from someone else. That rule paid dividends today.