The Importance of a Full Backup in SQL Server

Database Lifecycle Management, DevOps, Professional Development, SQL Server, SQL Server 2016
This is the first of 12 posts this year in support of Tim Ford's #iwanttohelp initiative. These will be completely 100 level, introductory blog posts meant to help people that are just getting started as data professionals. I'll try to cover several different topics over the year, but felt I should start with what I think is the most important, backups. It is impossible to overstate the importance of getting a good backup of your SQL Server databases. A backup is the most fundamental of protections for the information on which your business is dependent. Since SQL Server is a service, it manages it's own files. Because of this, you can't just copy the *.mdb file where your data is stored. Instead, you must run a process, usually through the…
Read More

Finding Your Query in Query Store

Azure, SQL Server 2016, T-SQL
Query Store is pretty amazing. I'm loving working with it. I think it's likely to change how query tuning will be done in the future. Lots of people are probably going to just use the reports and tools in SQL Server Management Studio. However, a pretty healthy chunk of us will start using the system views in order to programmatically access the information stored in Query Store. One of the first things you're going to want to do is track down your query. The primary views you'll want are sys.query_store_query and sys.query_store_query_text. They join together based on the query_text_id. Let's take four scenarios and see if we can retrieve the correct query. First up, an ad hoc query: SELECT e.NationalIDNumber, p.LastName, p.FirstName, a.City, bea.AddressTypeID FROM HumanResources.Employee AS e JOIN Person.BusinessEntityAddress AS…
Read More

Removing All SQL Server Query Store Data

Azure, SQL Server 2016
While setting up example code for my presentation at SQL Cruise (which is going to be a fantastic event), I realized I wanted to purge all the data from my Query Store, just for testing. I did a series of searches to try to track down the information and it just wasn't there. So, I did what anyone who can phrase a question in less than 140 characters should do, I posted a question to Twitter using the #sqlhelp hash tag. Jamey Johnston (t|b) came through... and it was right there in the documentation that I had been reading, over and over. In fact, it was in the documentation in two different places. Reading is clearly a problem for me today. Just so that you know, it's actually really easy:…
Read More

Learning R: Hitting the Books

Data Science
I've been using a series of web sites while I was starting the process of learning R. I've highlighted several of these in previous posts. While people will claim to learn better based on a single source-type, studies have found that you actually learn best by a multitude of methods. So, in addition to video instruction, web sites, guides, etc., I'm also going to read a few books to help learn R. After a lot of research, I've arrived at two that I'm starting with. The first is R In Action. I'm already on the 2nd chapter and I'm enjoying the style and approach. The other book is Using R for Introductory Statistics. I'm using this book because as I have already picked up, the real trick to learning R…
Read More

“Applies To…” in the MSDN Documentation

Azure, SQL Server 2016, T-SQL
Quick little post. I just wanted to share how happy I am with the new "THIS TOPIC APPLIES TO" infographic. An example here: I think it makes things much more clear when you're attempting to figure out what's up with some T-SQL syntax. Well done Microsoft and thank you. Side note, this only exists in documentation that has been updated recently. I first saw it in some documentation that was updated January 11, 2016. It's not there in another piece of documentation I saw that was updated October 15, 2015. Here's hoping it gets put everywhere. It works.
Read More

Restoring a Database in Azure

Azure
One of the many small things you don't have to worry about any more when working with Azure SQL Database are those pesky backups... Ha-ha-ha! Yeah, I can't keep a straight face when I type it. Microsoft takes on the role of DBA and creates backups and log backups for you when you're working in the Platform as a Service offering of Azure SQL Database. If that doesn't scare you, I'm not sure what will. However, there's good news. There are still ways for you to create your own backup (through the bacpac, I outlined it here, years ago). More good news is, Microsoft's backups actually work. Testing it out is easy. Let's walk through it once. I'm going to assume you have an Azure account on which you already…
Read More

Learning R: Hard Lessons

Data Science
I've always found the best way to learn a new programming language is to start building stuff, solving problems, using the language. Even if you do things badly or inefficiently, you're figuring out how to put the language to use. I tried the same thing with R. Fair warning, there is no happy conclusion to this story. It's a lesson about learning, not about solving a problem. After poking at the R language for a little while, I decided I was ready to solve a problem. I have a fantastic idea for demonstrating the usefulness of the language specifically for DBAs. I won't go into what it is here because I'm still hoping to solve this problem and it will provide a fantastic blog post. Anyway, I have a very…
Read More

Speaker of the Month: December 2015

PASS, Professional Development
The hardest presentations I've ever given in my life were not to large audiences or in big rooms. They weren't even when I had to present in front of people that I respect and admire (although presenting in front of Paul Randal (b|t) & Kim Tripp (b|t) gives me pause every single time, not sure why). I don't mind presenting all day sessions. In fact, I love the all day format. Nope, the hardest presentations for me are five minute lightning talks. They're brutal. They're unforgiving. You have to stop. You only get five minutes to tell people whatever it is you're going to tell them. Then its over. I've done three lightning talks. One of them, a rant on backup testing, I've given four or five times. The others all died…
Read More

Benefits from Data Lifecycle Management

Database Lifecycle Management, DevOps
I spend a lot of time talking about the need for automation within your databases, especially in support of development, deployment, and through process management. It's because I learned the hard way just how important this stuff is. It took a pretty strong developer (in the sense of abilities, he didn't beat me up) to convince me that I was doing database development the wrong way. However, once he made me see the light, I was like one of the Blues Brothers, on a mission. However, I think this is one of the hardest parts to get people to understand. If you have a mostly, or completely, manual deployment process, you're experiencing pain from the inefficiencies that causes. However, it's a pain that's just embedded into the organization so much, that…
Read More

One More PASS Board Update for 2015

PASS
Remember that post I wrote about taking on SQLSaturday events as my new PASS portfolio? Never mind.* Instead, it seems I'll be involved with a completely different role. Starting on January 1, I'll be moving onto the executive committee of the PASS Board and taking on the role of Executive Vice President. You can read the announcement here. While this means that I won't be directly involved in Chapters and SQLSaturday on a day to day basis, I will continue my engagement with Chapters until a new Director comes onboard and portfolio assignments are complete. As EVP, I want to stay engaged as possible in SQLSaturday in every way I can within my new role. I love SQLSaturday (and I don't mind saying, I was excited to receive that portfolio…
Read More