Estimated Costs of All Queries
One question constantly comes up; What should the Cost Threshold for Parallelism be? The default value of 5 is pretty...
2017-02-22 (first published: 2017-02-20)
2,517 reads
One question constantly comes up; What should the Cost Threshold for Parallelism be? The default value of 5 is pretty...
2017-02-22 (first published: 2017-02-20)
2,517 reads
The news cycle seems to be dominated by discussion of politics. Regardless of where you fall on the political spectrum, the talk of politics is inescapable and is probably going to lead to you being displeased with your fellow man. Luckily, we work in IT, so we can avoid politics. BWA-HA-HA-HA-HA! Politics goes way beyond […]
2017-02-20
141 reads
I love the questions I get while I’m presenting because they force me to think and learn. The question in...
2017-02-14 (first published: 2017-02-07)
1,514 reads
I was asked if there was an easy way to export all the plans from cache to a .SQLPLAN file....
2017-02-13
868 reads
So, my blog got hacked. They edited the page where I thanked Rodney for all that he did. I had...
2017-02-06
440 reads
I’m working on securing the blog. Please stand by. Apologies for any inconvenience or confusion.
The post I have been hacked...
2017-02-05
601 reads
Every Database Administrator, developer, report writer, and anyone else who writes T-SQL to access SQL Server data, must understand how to read and interpret execution plans. This book leads you right from the basics of capturing plans, through how to interrupt them in their various forms, graphical or XML, and then how to use the information you find there to diagnose the most common causes of poor query performance, and so optimize your SQL queries, and improve your indexing strategy.
2017-02-02
19,293 reads
The power and capabilities of Azure SQL Data Warehouse are pretty amazing. However, it’s still basically SQL Server under the...
2017-01-25 (first published: 2017-01-18)
1,112 reads
If you look at the Properties for the first operator of a graphical execution plan, you get all sorts of great...
2017-01-23
537 reads
Data Definition Language queries don’t go through the optimizer, right? While normally, my short answer to this question in the past would...
2017-01-10
600 reads
By Steve Jones
This is timely, as I’m currently on a boat in the Adriatic taking a...
You can find the slides and SQL scripts for my session “Spice up your...
By SQLPals
How to Clear the SSMS Cache (SSMS 21 and Later) Updated...
Comments posted to this topic are about the item Using CHOOSE()
Comments posted to this topic are about the item Re-Seeding a Broken Log Shipping...
Comments posted to this topic are about the item The DBA is Dead! Long...
We have this code that sets some status values and then queries them using the CHOOSE() function in SQL Server 2025.
CREATE TABLE Status
(
StatusID INT,
StatusDescription VARCHAR(20)
);
GO
INSERT dbo.Status
(
StatusID,
StatusDescription
)
VALUES
(0, 'Uncategorized'),
(1, 'Active'),
(2, 'Inactive'),
(3, 'Temp');
GO
SELECT CHOOSE(StatusID, 'Unknown', 'Active', 'Inactive', 'Temporary')
FROM Status;
When the SELECT runs, what is returned? See possible answers