SQL Server

Make Extended Events Great… Finally

SQL Server
13 Comments
SQL Server 2016 is adding some really awesome stuff Not the least of which is a ton of super cool information in execution plans, and an Extended Events session to expose the same information for all queries. The details are detailed in detail over on this blog post from MS. For those of you with…
Read More

The Joy of Joining on NULLs

SQL Server
43 Comments
With all the trouble NULLs cause… You’d think people would be more inclined to avoid them. Slap a NOT NULL constraint and a default value on your column and call it a day. I’m perfectly fine with bizarro world canary values. If it’s an integer column, some really high (low?) negative number. If it’s date-based,…
Read More

How to Split Strings with SQL Server 2016 & Newer

SQL Server
52 Comments
Before SQL Server 2016, you might have used a function like Jeff Moden’s DelimitedSplit8k function or Adam Machanic’s CLR version. (Aaron Bertrand has a huge post comparing performance of different string splitting methods, too.) But there’s a new, faster game in town! SQL Server 2016 introduces a brand new STRING_SPLIT function: Transact-SQL SELECT * FROM STRING_SPLIT('This is a space-delimited…
Read More

Unique Indexes and Row Modifications: Weird

Indexing, SQL Server
3 Comments
Confession time This started off with me reading a blurb in the release notes about SQL Server 2016 CTP 3.3. The blurb in question is about statistics. They’re so cool! Do they get fragmented? NO! Stop trying to defragment them, you little monkey. Autostats improvements in CTP 3.3 Previously, statistics were automatically recalculated when the…
Read More

Microsoft SQL Server is Coming to Linux.

Licensing, SQL Server
29 Comments
Two things: SQL Server is coming to Linux, and no, this isn’t April 1st, although the meeting minutes kinda read that way. Let’s zoom back for a second: if you want to expand an existing business, you have two good options: Sell a new product to your existing customers Sell your existing product to new customers For years,…
Read More

SQL Server 2016 Installation Screenshot Tour

SQL Server
24 Comments
SQL Server 2016 Release Candidate 0 is out. Here’s what the installation process looks like: Installation Center – not much new here until you click on the Installation tab Note that on the Installation tab, though, there’s a new line for “Install SQL Server Management Tools.” Management Tools got promoted (or is it voted off…
Read More

Database-Scoped Configurations Replace Trace Flags.

SQL Server
23 Comments
Trace flags are special switches that, when you flip them, enable different behaviors in your SQL Server. Back in the SQL Server 2000-2005 days, these were super-rare undocumented tricks that were handed out by Microsoft support to fix rare cases. Over time, some trace flags have become so commonplace that they worked their way into…
Read More

My Favorite System Column: LOG_REUSE_WAIT_DESC

Hidden away in master.sys.databases is one of the coolest diagnostic tools you might ever need: Transact-SQL SELECT name, log_reuse_wait_desc FROM sys.databases; 1 SELECT name, log_reuse_wait_desc FROM sys.databases; This spiffy little snippet will tell you why each database’s log file isn’t clearing out. Possible reasons include: Log backup needs to be run (or if you could…
Read More

Moving Databases with ALTER DATABASE

SQL Server
20 Comments
True story A long time ago, I had to actually do stuff to databases. One thing I had to do was move data files around. Maybe some knucklehead had put system databases on the C: drive, or a LUN was filling up, or we got a new LUN. You know, whatever. Natural curiosity oft leads…
Read More