Execution Plans in Extended Events
Extended Events is a wonderful tool. Execution Plans are also some wonderful things – or are a wonderful tool as well. Both of these tools are fantastic for troubleshooting. Combined,...
2015-06-17
20 reads
Extended Events is a wonderful tool. Execution Plans are also some wonderful things – or are a wonderful tool as well. Both of these tools are fantastic for troubleshooting. Combined,...
2015-06-17
20 reads
Extended Events is a wonderful tool. Execution Plans are also some wonderful things – or are a wonderful tool as well. Both...
2015-06-17
1,148 reads
Some of the beauty of being a database professional is the opportunity to deal with our friend NOLOCK. For one reason or another this query directive (yes I am calling...
2015-06-15
10 reads
I bring you yet another installment in the monthly meme called T-SQL Tuesday. This is the 67th edition, and this time we have been given the opportunity to talk...
2015-06-10
9 reads
Many moons ago, I published a post that contained a script to aid in easing the anxiety that comes when a database is “In Recovery”. When I pulled that...
2015-05-18
11 reads
Many moons ago, I published a post that contained a script to aid in easing the anxiety that comes when...
2015-05-18
485 reads
Welcome to the fabulous world of blog parties, SQL Server and what has been the longest running SQL Server related meme in the blogosphere – TSQLTuesday. This month we...
2015-05-12
9 reads
Welcome to the fabulous world of blog parties, SQL Server and what has been the longest running SQL Server related...
2015-05-12
559 reads
2015-05-11
1,633 reads
In the first article on this topic (which can be read here), I discussed the problem of having a database...
2015-04-15 (first published: 2015-04-07)
4,759 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