Reverse It
Recently I had a conversation with a colleague that wasn’t aware of the REVERSE function in SQL Server. I had...
2017-06-06
375 reads
Recently I had a conversation with a colleague that wasn’t aware of the REVERSE function in SQL Server. I had...
2017-06-06
375 reads
Recently I had a conversation with a colleague that wasn’t aware of the REVERSE function in SQL Server. I had...
2017-06-06
148 reads
M.A.S.H 4077. Mobile Army Surgical Hospital. One of my all time favorite TV shows that I still watch to this...
2017-06-05 (first published: 2017-05-23)
2,409 reads
I’m a huge fan of Ola Hallengren‘s free utility scripts. If you aren’t familiar with it, it’s a great tool to...
2017-05-30
371 reads
T-SQL Tuesday is a monthly blog gathering for the SQL Server/Data Professional community It is the brainchild of Adam Machanic (B|T)...
2017-05-25 (first published: 2017-05-09)
2,084 reads
M.A.S.H 4077. Mobile Army Surgical Hospital. One of my all time favorite TV shows that I still watch to this...
2017-05-23
120 reads
Have you every executed a query in SQL Server Management Studio, looked at the execution plan, and noticed that it...
2017-05-16
415 reads
I like scripts. Scripts that help me do things.
Working in the financial industry, there are always things that you have...
2017-05-04 (first published: 2017-04-25)
1,474 reads
In early June, I’ll be traveling to Pensacola, Florida for their annual SQL Saturday. This will be my second time...
2017-05-02
332 reads
Sometimes you get reminded that you don’t know everything about SQL Server and it’s various products Every time I run...
2017-04-27
575 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