Introducing The Blame Game
Introducing the Blame Game! Someone has messed up the new anatomy application’s (Mr. Body) performance and no one is willing...
2018-03-26
293 reads
Introducing the Blame Game! Someone has messed up the new anatomy application’s (Mr. Body) performance and no one is willing...
2018-03-26
293 reads
You need to move a table from one instance to another with the following requirements:
The instances are on separate domains....
2018-03-21
375 reads
I joined in on an interesting conversation the other day on twitter. It was about some unusual ramifications of GDPR...
2018-03-19
409 reads
I’d never seen ORIGINAL_DB_NAME until recently and I thought it would be interesting to highlight it out, and in particular...
2018-03-27 (first published: 2018-03-15)
2,906 reads
The date is July 14th, 2026 and it’s TSQL Tuesday #200. We are still using SQL Server, and in fact...
2018-03-13
295 reads
Debugging is a life skill. Yes, the term comes from IT (literally removing a bug from a computer believe it...
2018-03-19 (first published: 2018-03-07)
2,066 reads
My very first SQL Homework post was about taking a backup. The vast majority of people who work with databases...
2018-03-05
301 reads
If you are a Sr DBA or developer you have probably had some variation of this conversation at multiple points...
2018-02-28
415 reads
tl;dr; SQLCMD v2014 and up has special requirements for Kerberos.
One of the problems with linked servers (no rude noises please)...
2018-02-26
2,132 reads
If you’ve never worked with windowing functions they look something like this:
SELECT name, max(create_date) OVER
-- No this isn't meant to...
2018-02-21
1,488 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