2020-05-09
156 reads
2020-05-09
156 reads
In this Database Fundamentals post we continue discussing the functionality of the WHERE clause. We started with the basics of the logic using things like AND, OR and LIKE...
2020-05-04
120 reads
I am very excited to announce that I will be taking my paid precon content “Tools for SQL Server Query Performance Tuning” and presenting it for free. This is...
2020-04-23 (first published: 2020-04-16)
180 reads
Over the next couple of months, I’ll be putting on a number of different sessions teaching about the tools supplied by Microsoft, for free, that can help you when...
2020-04-20
248 reads
We are all going through some tough times. It’s tougher for some more than others. Now is the time when you have to work on being resilient, and it...
2020-04-13
24 reads
2020-04-11
168 reads
Reading about how hackers are using SQL Server instances that are exposed on the internet AND have weak passwords to work into systems, I’m sitting here wondering why. I...
2020-04-06
78 reads
I love this quote from Kevin Hill (and not because he mentions me): 3 things I can no longer justify ignoring: #dbatools Git and #Docker for my dev SQL work@cl@sqldbawithbeard@Kendra_Little and @unclebiguns@GFritchey, I blame you...
2020-04-03 (first published: 2020-03-26)
1,103 reads
I sincerely believe the key to your future as a DBA is your ability to automate everything you do. However, the single hardest thing that you have to do...
2020-03-31 (first published: 2020-03-25)
456 reads
Actually, these two topics don’t have anything to do with one another. I just ran out of days to promote everyone individually who was taking part in putting on...
2020-03-31
17 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