Black Friday prices end in 9d 11h 16m — See the sale

Category: SQL Server 2022

[Video] I Must Be an Idiot: Automatic Tuning Never Works for Me.

I don't get it. I've given this feature one chance after another, and every time, it takes a smoke break rather than showing up for work.

The latest instance involved the recent Query Exercise where you were challenged to fix a computed column's performance. In the comments, some folks noted that performance of the query was actually great on old compat levels, like SQL Server 2008, and that it only sucked on newer compat levels like 2016 and later.

Read more about [Video] I Must Be an Idiot: Automatic Tuning Never Works for Me. 21 comments — Join the discussion

How to Install SQL Server and the Stack Overflow Database on a Mac

To follow along, you'll need:

An Apple Mac with an Apple Silicon processor (M1, M2, etc - not an Intel or AMD CPU)
Docker Desktop 4.25 or newer
Something to run queries on SQL Server - unfortunately, Microsoft's own Azure Data Studio has been put out to pasture, so your options are tools like VS Code, DBeaver, or Jam Studio
An Internet connection

Read more about How to Install SQL Server and the Stack Overflow Database on a Mac 14 comments — Join the discussion

SQL Server 2022 Release Date: November 16, 2022

Microsoft released SQL Server 2022 today, November 16, 2022.

The footnotes indicate:
SQL Server 2022 free editions (Developer edition, Express edition) are available to download starting today. SQL Server 2022 paid editions (Enterprise edition, Standard edition) will be available in Volume Licensing (Enterprise Agreement, Enterprise Agreement Subscriptions) customers starting today, which represents the majority of SQL Server customers. Customers purchasing via CSP, OEM, and SPLA can begin purchasing SQL Server 2022 in January 2023.
Learn more about what's new in SQL Server 2022.

Read more about SQL Server 2022 Release Date: November 16, 2022 7 comments — Join the discussion
Performance Tuning

PSPO: How SQL Server 2022 Tries to Fix Parameter Sniffing

Parameter sniffing is a notorious problem for Microsoft SQL Server because it tries to reuse execution plans, which doesn't work out well for widely varying parameters. Here's a primer for the basics about how it happens. SQL Server 2022 introduces a new feature called Parameter Sensitive Plan optimization. I'm not really sure why Microsoft capitalized…

Read more about PSPO: How SQL Server 2022 Tries to Fix Parameter Sniffing 38 comments — Join the discussion

What’s New in SQL Server 2022 Release Candidate 0: Undocumented Stuff

Microsoft has an official list of what's new in 2022 overall, but here I'm specifically focusing on system objects that might be interesting to script developers like you and I, dear reader. New stored procedure sp_get_table_card_est_and_avg_col_len - I assume the "card" refers to statistics and cardinality, not Hallmark. SQL Server has historically struggled with memory…

Read more about What’s New in SQL Server 2022 Release Candidate 0: Undocumented Stuff 24 comments — Join the discussion

Pour One Out for Distributed Replay. It’s Deprecated in SQL Server 2022.

I love how Microsoft treats deprecated and discontinued features in SQL Server.

No, seriously. I give Microsoft a lot of sarcasm and lip around here, but Microsoft takes serious care to make it easy to upgrade versions without worrying about your application breaking. If you disagree, hear me out for a minute.
"Discontinued" means it's dead and removed.
The Books Online page for discontinued database engine functionality is pretty doggone short. There have only been a few things deprecated in the last several years:

Read more about Pour One Out for Distributed Replay. It’s Deprecated in SQL Server 2022. 12 comments — Join the discussion
Performance Tuning

SQL Server 2022 Tells You Why A Query Can’t Go Parallel.

Until 2022, when a query couldn't go parallel, all we got was a really cryptic note in the execution plan properties saying NonParallelPlanReason = CouldNotGenerateValidParallelPlan.

But starting with SQL Server 2022, even when I'm running under older compatibility levels:
[crayon-6b0191a1a4e1a697246606/]
The execution plan gives me way more details:

Read more about SQL Server 2022 Tells You Why A Query Can’t Go Parallel. 10 comments — Join the discussion