Blog

Database Fundamentals #24: Filtering Data

Database Fundamentals, SQL Server
If you've been reading these Database Fundamentals posts, you've already seen the WHERE clause because of your use of it when manipulating data with DELETE and UPDATE statements. It's also been used several times earlier in this series to limit the values returned from a SELECT statement. The primary places where people run into trouble with T-SQL is in the JOIN criteria and the WHERE clause criteria. This occurs because they don’t understand well enough what the filters and operators they’re using will do. They end up returning too much data because they didn’t us the WHERE clause or misapplied it. They also filter too much data out. Just remember, there are even more functions than we go over here in this series. While these basic operators answer most needs,…
Read More

SQL in the City/PASS Summit

Uncategorized
My great organization, Redgate, is doing things a little different this year at PASS Summit. Instead of hosting our own event, we've decided to host a pre-con at the Summit itself to pass the word on all the amazing work we're doing. It's still going to be called SQL in the City. Follow the link to see the schedule and all the excellent topics. This means, if you're coming to Summit, you can sign up for a precon that will be given by the great team at Redgate all about all the great Redgate tools. Follow this link to get registered. I'll be talking about 10 Steps you can take to make your data compliant, world-wide. You'll also get to hear from Kendra Little, Steve Jones, Arneh Eskandari, Ike Ellis…
Read More

SQL Injection Mitigation in SQL Server 2019

SQL Server
I've been teaching a lot more about SQL Injection lately (including blog posts). I've been doing this because, despite this being a 21 year-old problem with well defined solutions, we're still dealing with it. Recently, while sitting in the speaker room at Techorama Netherlands (fantastic event, strongly recommended), I had the opportunity to spend a little time with Niko Neugebauer. I was freaking out because my demos were failing (fixed 'em finally). Niko was talking to me about the new Feature Restrictions and their effect on SQL Injection in SQL Server 2019. I didn't know what he was talking about, so I had to look it up. Of course, top resource, Niko's blog. Feature Restrictions in SQL Server 2019 The Feature Restrictions in SQL Server 2019 are actually being added…
Read More

Humbled

Uncategorized
I've received several notes of thanks over the last couple of weeks. I'm not sure exactly what's prompted this sudden outpouring because it's all been about stuff I've done over the years, not anything recent. I've tried to always thank privately those who've sent something along these lines. I may not always do it though. So, just in case, let me publicly state: Thank you for saying that anything I do helps. I freely admit, I'm actively trying to help out. I'm still regularly surprised that any of it's useful. I'm quite humbled by your kind words. I truly appreciate them. I vow to continue to try to be useful. I'll do my best to earn what you've given.
Read More

Database Fundamentals #22: Using the Join Operator, CROSS JOIN

Database Fundamentals
While the CROSS JOIN is not used much, and, depending on the size of your data it can be dangerous, there are some uses for it. For example, you may want to write a query that will summarize all the sales for the companies and people in your system. You can do this using what is called an aggregate operation or a GROUP BY: SELECT c.CompanyName, p.LastName, SUM(ft.TransactionAmount) AS 'TransactionTotals' FROM Management.Company AS c JOIN Finance.FinancialTransaction AS ft ON c.CompanyID = ft.CompanyID JOIN Personnel.Person AS p ON p.PersonID = ft.PersonID GROUP BY c.CompanyName, p.LastName; This will add all the values up in the SUM operation for each company and each person that has values so that your data will look like this: The only problem with this is, you can’t…
Read More

Get the Last Actual Plan With sys.dm_exec_query_plan_stats

SQL Server, T-SQL
I've always felt responsible for making such a big deal about the differences between estimated and actual plans. I implied in the first edition of the execution plans book (get the new, vastly improved, 3rd edition in digital form for free here, or you can pay for the print version) that these things were so radically different that the estimated plan was useless. This is false. All plans are estimated plans. However, actual plans have some added runtime metrics. It's not that we're going to get a completely different execution plan when we look at an actual plan, it's just going to have those very valuable runtime metrics. The problem with getting those metrics is, you have to execute the query. However, this is no longer true in SQL Server…
Read More

Techorama Netherlands 2019

SQL Server
You only have a few more weeks to sign up for one of my favorite events, Techorama. This year is the second time the event will be held in the Netherlands (it started out in Belgium). I'm very honored to get to say that I'll be speaking again this year. The reason I like the event so much is because of how it draws from pure developers, architects, data specialists and analysts almost equally. Techorama succeeds at getting all the people into the room that ought to be in the room. Then, Techorama makes it possible for all these people to share knowledge and understanding about the Microsoft stack. I have several different sessions, but the one I want to talk about at the moment is the one on SQL…
Read More

20 Years of Redgate Software

Redgate Software
Yeah, Redgate is only one year younger than my children. What's really frightening is that I've been using Redgate's products since my kids were a year old. I was a VERY junior DBA twenty years ago having just made the move from full time development. I'll tell you though. I think I had Redgate's SQL Compare open on my desktop non-stop from the moment it was available. I know I personally ensured that four different organizations purchased at least one license. Now here we are, twenty years later. My kids are grown, but I'm still gleefully using Redgate Software. Yeah, I know, now I work for them, but that's just a bonus as far as I'm concerned. I've been praising and promoting Redgate for twenty years and I hope I…
Read More

Certifications are a Bonus, Not A Path to Employment

Professional Development
I've never been terribly shy about my beliefs about IT certifications. I sincerely believe they are largely a waste of time. I do recognize that one thing they do provide is a documented learning path. Having gone through that learning path, you will gain knowledge. Knowledge, I very much believe in. Unfortunately, certifications are not an actual demonstration of knowledge. I also know that for some organizations, having certified individuals gets them partner status and all that entails. Again, this means that the certificate is a bonus, not one of the major qualifications for a given position. If I worked for one of these organizations, I'd go and get certified. Otherwise, why bother? Which Certification Will Get Me a Job in IT? If you've never seen this question before, you…
Read More

DevOps for the DBA, Slide Deck

DevOps
I have an all day seminar I give called "DevOps for the DBA". If you're attending, thinking of attending, or you have attended, you might want to have the slide deck to review. I have published it here at SlideShare.Net. Fair warning. The slides are not the presentation. When you're attending a class that I teach, you're there for the live, in-person, interactive event of the training. The slides are not meant to be documentation. They are simply guideposts to keep me on track and to help illustrate certain points. If they are helpful to you, I'm happy to share. I just want you to know that reading through the slides can in no way be a substitute for actually showing up. If you would like to attend this seminar,…
Read More