Different methods to generate query execution plans
One of the things I enjoy about my job is when I have to develop or review some T-SQL code,...
2018-09-10
770 reads
One of the things I enjoy about my job is when I have to develop or review some T-SQL code,...
2018-09-10
770 reads
I’ve read a lot of things lately pointing to scalar functions as if they were the devil. In this blog...
2018-09-18 (first published: 2018-09-10)
4,044 reads
While all plans are estimated plans, there is still a difference between capturing an estimated plan and looking at a...
2018-09-20 (first published: 2018-09-10)
1,770 reads
There isn’t a degree to be gained, but you can get a lot of information about Redgate products at Redgate...
2018-09-10
230 reads
(Be sure to checkout the FREE SQLpassion Performance Tuning Training Plan - you get a weekly email packed with all the...
2018-09-20 (first published: 2018-09-10)
2,497 reads
Introduction To Deadlock
Deadlock in SQL server is a condition in which two or more system server processes IDS (SPIDs) are waiting for a resource. No process can get the...
2018-09-10
36 reads
Introduction To Deadlock
Deadlock in SQL server is a condition in which two or more system server processes IDS (SPIDs) are...
2018-09-10
2,785 reads
No, not quite. I have had many interesting conversations around this topic and I don’t think (personal opinion) that DBAs...
2018-09-10
656 reads
In SQL Server 2016 we saw Query Store. Query Store was a game changer to help database administrators identify troublesome queries. Query Store helps DBAs make those queries run...
2018-09-10
76 reads
In SQL Server 2016 we saw Query Store. Query Store was a game changer to help database administrators identify troublesome...
2018-09-19 (first published: 2018-09-10)
2,970 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