The most-read posts in 2018
Good morning #sqlfamily folks! The very first post in the new year 2019. Tell me: when this time passed??? The...
2019-01-01
205 reads
Good morning #sqlfamily folks! The very first post in the new year 2019. Tell me: when this time passed??? The...
2019-01-01
205 reads
There was this incident at one of the clients in recent past. It was a nice morning. I was enjoying the tea of the day. I just started my...
2019-01-01
49 reads
I’ve just signed up on Microsoft’s new learning opportunity Microsoft Learn. The main categories are Azure, Business Apps, and Windows...
2018-12-31
438 reads
Firstly, all of us at SQL Undercover would like to wish you a very Happy New Year and all the...
2018-12-31
247 reads
Get off that arctic island and warm up with a little XE fun. This script is quite simple but will show you what you may have out there on...
2018-12-31
10 reads
As a DBA, it is not uncommon to feel like you are marooned off on some tiny little island trying...
2018-12-31
212 reads
(2018-Dec-31) Back in July of 2018, Ontario provincial government of Canada decided to decrease the number of Toronto city wards from 47...
2018-12-31
1,425 reads
Earlier this week, I blogged about the automatic cleanup process that purges old data from the SSIS catalog logging tables. This nightly process removes data for operations that are...
2018-12-30
14 reads
Earlier this week, I blogged about the automatic cleanup process that purges old data from the SSIS catalog logging tables....
2018-12-30
364 reads
I mean, it can’t be that my calendar shows December and the year is almost over? Alright, I see I...
2018-12-30
209 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