General Notes on Security in Azure SQL Data Warehouse

Azure
I'm still learning about Azure SQL Data Warehouse (ADW, cause I'm lazy). ADW is a deceptively deep topic. Initially you think that it's just SQL Server, what's the big deal. Then you start to understand the underlying architecture and things get complicated. Then you begin to understand the implications of the architecture and things get down right arcane. However, I'd like to talk about some relatively easy concepts around security in your Azure SQL Data Warehouse. For lots more detail, see the excellent documentation provided by Microsoft. Firewall Security The single most important aspect of security in and around Azure is the fact that for the public facing aspects (and the database stuff is public facing), there is a built-in firewall. This firewall is enabled by default and actually can't…
Read More

Redgate Alexa Contest Winners!

Red Gate Software
A couple of weeks ago we had a small contest here to pick a skill for Alexa. The entries were all wonderful, but I could only pick five as winners with one of them being the top winner. Thanks everyone for playing. In no particular order, here are the four runner's up, followed by the final winner along with my comments. Adrian Porter:  Alexa, let's get real here! Please protect me from my stupid self. Take whatever measures needed. And for the final time, I don't want to play chess, let's play Global Thermonuclear War! [major points for an excellent nerd reference and one of my favorite movies] Zingiber: Alexa, drive me to work [You have to love the short simple set of instructions here, plus, extra time to read…
Read More

Food On Your Table

PASS
I was asked, "Who here thinks that PASS helps people put food on the table?" To my shame, I initially said no. I mean after all, it's just training and networking that could lead to improved knowledge and abilities which... hang on. Just how wrong I can be sometimes when I don't fully engage my brain prior to speaking. The Table and the Food I'm almost entirely self-taught when it comes to IT. I make that claim all the time. You know it's not true. Do I have formalized educational training from any type of certified body? You know, a university education? Nope. Not at all. Instead, I've learned from a combination of experimentation, books, blogs, videos, friends, contacts and some classes at a variety of venues. Notice what's wrong there? Only…
Read More

Query Hash Values, Plan Guides and the Query Store

SQL Server 2016
I was eating dinner with Hugo Kornelis and we started talking about query hash values. You know, like everyone does at dinner. As we talked about it, I suddenly thought about both Plan Guides and the Query Store. I wondered what happened to the query hash values in that case? Thus are blog posts born. Query Hash and Plan Guides The behavior of the query hash itself is fairly straight forward. The text of the query is run through a hashing algorithm within SQL Server and a value comes out, so these two queries: SELECT * FROM Sales.SalesOrderDetail AS sod JOIN Sales.SalesOrderHeader AS soh ON sod.SalesOrderID = soh.SalesOrderID; SELECT * FROM Sales.SalesOrderDetail AS sod JOIN Sales.SalesOrderHeader AS soh ON sod.SalesOrderID = soh.SalesOrderID OPTION (FORCE ORDER); Result in two different query…
Read More

The Age of Data and Software Development

Professional Development
I am so excited to be a data professional in the modern era. Yeah, 15-20 years ago, it was cool to be a DBA and a database developer. However, now, it's amazing. Data drives, or should drive, all our decisions. Whether we're deciding how high to set the cost threshold for parallelism, which query we want to tune, or even which product would serve us best, we should be making these decisions based on data. It's not just about getting the average or the min & max, although, those are the start points. Now, you need to start to take into account standard deviation and you probably should learn how to run a regression analysis. All these tools will make you a better more valuable employee. It's not any different…
Read More

Alerts From Azure Automation

Azure
In a previous post, I showed how to set up statistics maintenance for your Azure databases using Azure Automation. However, what I didn't show was how to generate an alert when things go south. Let's do that now. An Error Needing an Alert First, I need to generate an error. I'm going to modify the code just slightly from the previous example so that it will fail: $Cmd=new-object system.Data.SqlClient.SqlCommand("UPDATE STATISTICS dbo.TableNotInDB", $Conn) If I modify my Runbook with the code above and then run it, I will get an error: This is from the test pane. I strongly recommend you use tests on your PowerShell scripts when writing your own automation. It'll save you a lot of pain trying to troubleshoot things later. Alert on Error Believe it or not,…
Read More

Learning Azure From The Web

Azure
I'm working on a technical blog post that I hope to be putting up soon. I've run into a number of configuration issues that I'm working through. However, it's these issues that sparked this blog post. See, we're learning Azure all wrong. Use Google/Bing What's the first thing you do when you hit a problem on your computer, regardless of the language, the technology, etc.. Wrong! You don't call your son-in-law who "works in computers." That's what my mother-in-law does. We already "work in computers" so we have another resource. Bingle/Ging/Boogle. We run a search. So, let's say for example I'm interested in learning about an Azure Powershell command: Set-AzureRMDiagnosticSetting. Here are the first two results from Google (as of this date, 4/3/2017, or for all my UK friends, 3/4/2017,…
Read More

Random Blogging Challenge Results

Professional Development
The winner is: Everyone. Hey, the challenge was random. I didn't promise a prize or a winner. Instead, I suggested everyone blog based on an image of the great Tom Baker: In no particular order we have: Persist and Aggregate Index Stats Across Server Restarts by Eric Cobb Nice use of the image, incorporating it into an interesting technical post on how to persist your index usage stats. Useful information since this DMV is reset when you restart the server (or fail it over or...). Good technical blog on a useful topic, data about your system. Working with SQLSaturday SpeedPass by Wayne Sheffield +10,000 points for both using the image well and for the PowerShell. -10,000 points for making me comment on a post about PASS (I'm the EVP of…
Read More

Sharing With You In All Fifty States

Misc
I made a mistake the other day. For some reason I got it into my head that I was flying to Albuquerque when I was actually flying to Phoenix. I've no idea how or why that occurred, but I sent a tweet out on how excited I was to finally be visiting and presenting in New Mexico for the first time. Yeah, oops. But here's the deal. It got me thinking. I've been presenting professionally for quite a while. I've visited a lot of places around the world because of this. I want to visit a lot more. I've decided to work closer to home as well as elsewhere. I Want to Speak in All Fifty States I've presented live sessions to user group meetings, SQLSaturdays, Code Camps, and large events all…
Read More

Why You Should Change the Cost Threshold for Parallelism

SQL Server 2005, SQL Server 2008, SQL Server 2012, SQL Server 2014, SQL Server 2016
I've written several times about the Cost Threshold for Parallelism and it's relationship to your execution plans, how to determine your execution plan cost, and even how to decide what value to set your Cost Threshold to. What I haven't explicitly addressed in extremely clear terms is why you should adjust your Cost Threshold for Parallelism. There are two reasons to modify this value. Cost Threshold for Parallelism Default Value The primary reason to change the Cost Threshold for Parallelism is because the default value is not a good choice for the vast majority of systems. The default value is 5. This means that when a query has an estimated cost greater than 5, it may get a parallel execution plan. Microsoft set the default value for the Cost Threshold…
Read More