Extended Events: Queries and Waits
Wouldn’t it be great to be able to put together queries and waits at the same time? You all capture query metrics using some method. Most of us query...
2020-03-30
26 reads
Wouldn’t it be great to be able to put together queries and waits at the same time? You all capture query metrics using some method. Most of us query...
2020-03-30
26 reads
Over the last couple of years, one of these single most exciting technologies to come out around the Data Platform has been containers. You may not see them change...
2020-03-27 (first published: 2020-03-20)
309 reads
There’s a really simple conundrum that we go through all the time. The best data for development is production You can’t have production data for development You have to...
2020-03-27
148 reads
Or database developer, report writer, whatever. SQL Server, SQL Server Management Studio, and all the tools provide a bunch of ways to get things done. However, some ways are...
2020-03-24
55 reads
One reason a lot of people don’t like Extended Events is because the output is in XML. Let’s face it, XML is a pain in the bottom. However, there...
2020-03-24 (first published: 2020-03-16)
268 reads
Of all the things that Extended Events does, I’ve found the ability to quickly and easily gather a little bit of data and then use the Data Explorer window...
2020-03-23
103 reads
I am an introvert. Lots of people don’t believe it, but it’s true. However, I really do love getting to see my #SQLFamily all over the world in my...
2020-03-19
25 reads
Wouldn’t it be great to just quickly and easily take a look at your system to see if you had any queries that ran for a long time, but,...
2020-03-16 (first published: 2020-03-09)
585 reads
There is only one kind of execution plan within SQL Server. I’ve said this several times on this blog. Now, I’d like you to go and read this excellent...
2020-03-11 (first published: 2020-03-03)
340 reads
I absolutely love Query Store and the ability it provides to force a plan is amazing. However, there are a lot of little gotchas in this functionality. I just...
2020-03-09 (first published: 2020-03-02)
421 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