My backup script (where, how, how big, etc.)
A while back I wrote about how to find where your backups are. And I’ve also written about I use...
2018-12-10 (first published: 2018-11-26)
2,084 reads
A while back I wrote about how to find where your backups are. And I’ve also written about I use...
2018-12-10 (first published: 2018-11-26)
2,084 reads
Shadow IT has been, well, maybe not the bane of the IT department, but certainly a pain in the neck....
2018-11-21
940 reads
To help promote the seperation of duties one of the things my company has done is to divide our permissions...
2018-11-29 (first published: 2018-11-19)
2,401 reads
Ok, that title sounds silly, but it’s actually a real point. The first parameterized refers to using parameters within dynamic...
2018-11-23 (first published: 2018-11-15)
2,538 reads
Upper management at my company has started asking for something called T-Shaped knowledge. The idea is that we have a...
2018-11-13
229 reads
It’s the start of Summit for many of us (not me, sorry) and it seemed like a good time to...
2018-11-07
233 reads
You’ve created tables before but how about constraints? Constraints allow a finer level of control over what data is allowed...
2018-11-14 (first published: 2018-11-05)
1,943 reads
It Halloween so time for a scary SQL story. Ok, maybe not that scary. Ok, not scary at all, but...
2018-11-12 (first published: 2018-10-31)
2,906 reads
There is a fear that almost every blogger has to overcome. I’ll be honest, it pops up almost every time...
2018-10-29
322 reads
A while back a friend of mine, Malathi Mahadevan (b/t), asked me if I’d like to do an interview for...
2018-10-24
237 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