Finding Top Offenders with Extended Events
This week at MVP Summit I got to talk with a friend who loves profiler. We were talking about capturing...
2018-03-06
298 reads
This week at MVP Summit I got to talk with a friend who loves profiler. We were talking about capturing...
2018-03-06
298 reads
This week at MVP Summit I got to talk with a friend who loves profiler. We were talking about capturing workloads and doing analysis on them. T-SQL or other...
2018-03-06
17 reads
T-SQL Tuesday #96: Folks Who Have Made A Difference
Today’s blog post is about T-SQL Tuesday. If you haven’t seen T-SQL...
2017-11-14
961 reads
Today’s blog post is about T-SQL Tuesday. If you haven’t seen T-SQL Tuesday before its a great monthly call for all SQL Server bloggers to write about one topic...
2017-11-14
14 reads
In some DBA circles, backups are just as popular as politicians! However, recoverability is the most important task for database...
2017-11-10 (first published: 2017-10-31)
2,599 reads
In some DBA circles, backups are just as popular as politicians! However, recoverability is the most important task for database administrators. While SQL Server 2017 added so many great...
2017-10-31
67 reads
Speaking on Migrating to Azure SQL Database at Ignite 2017
This week I will have two talks on migrating existing database...
2017-09-25
371 reads
This week I will have two talks on migrating existing database to Azure SQL Databases at Microsoft Ignite. If you are there and curious about migrating your existing databases...
2017-09-25
8 reads
These days I do a lot of testing with SQL Server. When I am testing new features or helping clients...
2017-03-10
663 reads
These days I do a lot of testing with SQL Server. When I am testing new features or helping clients implement SQL Server High Availability solutions I want to...
2017-03-10
50 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