What do they want to hear?
I was helping my 16yo write his first college essay the other day. He’s always struggled a bit with writing ... Continue reading
2020-11-03 (first published: 2020-10-29)
328 reads
I was helping my 16yo write his first college essay the other day. He’s always struggled a bit with writing ... Continue reading
2020-11-03 (first published: 2020-10-29)
328 reads
I get that linked servers are almost as despised as the dreaded cursor or (lord save us) NOLOCK, but they ... Continue reading
2020-10-29 (first published: 2020-10-27)
862 reads
I was recently watching the first session of the Azure SQL Bootcamp by Anna Hoffman (twitter) and Bob Ward (blog|twitter) ... Continue reading
2020-10-22
186 reads
It took me a little bit longer to get here than I expected but I finally made it. 800 posts. ... Continue reading
2020-10-20
15 reads
I was recently asked to add on to my permissions stored procedures (sp_SrvPermissions, sp_DBPermissions and sp_AzSQLDBPermissions) and create one for ... Continue reading
2020-10-22 (first published: 2020-10-15)
274 reads
Rob Volk (blog|twitter) is our host for TSQL Tuesday this month and wants us to Explain a database subject like ... Continue reading
2020-10-20 (first published: 2020-10-13)
478 reads
Quick post today. Recently I was helping a co-worker write a trigger. Basically there is a table of servers that’s ... Continue reading
2020-09-11 (first published: 2020-09-03)
478 reads
Triggers. Still blech. In June I asked you to play with DML triggers. Well, one more time. First of all ... Continue reading
2020-09-01
118 reads
TL;DR; Yes Frequently in our industry we talk about gatekeepers as bad things. We talk about breaking down barriers and ... Continue reading
2020-08-27
192 reads
Well, I’m running a bit late. Both for this month and the fact I completely missed last month. It was ... Continue reading
2020-08-13
91 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