How to read a technical blog
There are thousands, tens of thousands, probably hundreds of thousands of blogs out there on all sorts of topics. If...
2018-01-17
315 reads
There are thousands, tens of thousands, probably hundreds of thousands of blogs out there on all sorts of topics. If...
2018-01-17
315 reads
A few weeks ago, I wrote Part 1 and 2 of this series, which was a beginner’s guide to Always...
2018-01-17
788 reads
Database Console Command CHECKDB (DBCC CHECKDB)is used to check the integrity (physical & logical) of objects in a SQL Server database.The...
2018-01-17
62,667 reads
I work with SQL Server in containers pretty much exclusively when testing code and one of my real bug bears...
2018-01-17
1,128 reads
I typically don’t turn on line numbers if SSMS, but while working with someone on a bit of code, they...
2018-01-16
23,222 reads
You may have noticed that there are many menu commands that don’t have a keyboard shortcut. For instance, SQLCMD mode...
2018-01-16
124 reads
You may have noticed that there are many menu commands that don’t have a keyboard shortcut. For instance, SQLCMD mode...
2018-01-16
373 reads
PASS has released the videos to members from this past Summit. I say TJay Belt today ask about relating a...
2018-01-16
576 reads
Hello!
Not so long ago, I wrote about how dbatools now has functions that can be used to deploy dacpacs. What...
2018-01-16
340 reads
Hello all,
I’ve recently updated my YouTube channel. I’m going to be posting a lot more videos up there. If you...
2018-01-16
326 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