SQL Homework – January 2020 – Document, document, document
Happy New Year! It being New Year’s, at least by the Gregorian calendar, I thought we could make this month’s ... Continue reading
2020-01-01
31 reads
Happy New Year! It being New Year’s, at least by the Gregorian calendar, I thought we could make this month’s ... Continue reading
2020-01-01
31 reads
One of my all time favorite movies is Groundhog Day staring Bill Murray. In case you’ve never watched it (and ... Continue reading
2020-01-10 (first published: 2019-12-30)
426 reads
A few months back I put the Azure SQL DB version of my permissions script into beta. I’m not sure ... Continue reading
2019-12-18
61 reads
You are probably already aware that you can disable an index. This can be handy when you have a large ... Continue reading
2019-12-30 (first published: 2019-12-16)
1,009 reads
I was recently given the opportunity to speak at Pass Summit. As always (this is the second time) this was ... Continue reading
2019-12-12
15 reads
My good friend Malathi Mahadevan (blog|twitter) is hosting T-SQL Tuesday this month and wants us to talk about Gifts received ... Continue reading
2019-12-23 (first published: 2019-12-10)
297 reads
I love this error. Primarily because it demonstrates two very important things. Errors matter. Make sure when you ask someone ... Continue reading
2019-12-11 (first published: 2019-12-05)
671 reads
I know this is the holiday season for many of us (which ones depend on your religion and nationality of ... Continue reading
2019-12-17 (first published: 2019-12-02)
450 reads
One of my favorite presentations is Revenge the SQL by Rob Volk (blog|twitter). It’s a demonstration of a lot of ... Continue reading
2019-12-12 (first published: 2019-11-27)
1,147 reads
I mentioned arrays in a previous post so I figured I should talk about what they are and how to ... Continue reading
2019-12-06 (first published: 2019-11-25)
467 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