Friday Fun – Football Derbies
This is an off-topic post for a Friday. With Cardiff City reaching the premier league this week and all the...
2013-04-19
617 reads
This is an off-topic post for a Friday. With Cardiff City reaching the premier league this week and all the...
2013-04-19
617 reads
If you can establish a connection to a SQL Server, but are having problems logging in to it, you will...
2013-04-30 (first published: 2013-04-18)
2,582 reads
When I first started working with Azure SQL Databases, I wasn’t sure what it would take to backup a database....
2013-04-18
1,816 reads
Dynamic SQL can be helpful, but a pain to debug. I spent hours today working on figuring out why my...
2013-04-18
443 reads
One of the goals early on with SQL Saturday was to spread them far and wide. Andy Warren and I...
2013-04-18
791 reads
There has been lots of speculation in the SQL Server community as to what the official name of the next...
2013-04-18
1,280 reads
I went to the PASS Business Analytics Conference last week, and had an absolute blast. I presented two sessions, and...
2013-04-18
1,189 reads
Introduction
A few months back, I was asked how long a particular nightly process took to run. It was a super...
2013-05-01 (first published: 2013-04-18)
6,538 reads
Populating default dates in SSRS can be helpful to save the user from having to constantly input the date range...
2013-04-18
111,235 reads
Copy and Paste the below content in Set-FindandReplaceString.PS1. Please read the instructions carefully. Try to do a dry run on some...
2013-04-17
713 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