Benefits for Some, All or Only a Few
As a member of the PASS Board of Directors I attended the PASS Business Analytics Conference (BAC) recently. You can...
2015-04-27
521 reads
As a member of the PASS Board of Directors I attended the PASS Business Analytics Conference (BAC) recently. You can...
2015-04-27
521 reads
The new portal for managing Azure is pretty. I’m not sure I’m in love with it, but it’s pretty.
However, one...
2015-04-24 (first published: 2015-04-13)
5,260 reads
It’s been a pretty interesting month on the board.
First, we did have a little problem. I’m sure one or two...
2015-04-23
534 reads
The question came up on SQL Server Central that someone wanted to track queries on their 2008R2 instance and on...
2015-04-21
632 reads
I spend many of my evenings researching and writing. Sometimes it’s writing new books. Sometimes it’s fixing and rewriting old...
2015-04-16
685 reads
I’ve posted previously about how a foreign key constraint can change how a SELECT query behaves. Logically that just makes...
2015-04-16 (first published: 2015-04-06)
7,527 reads
I decided in January that I would write regularly about people that I’m grateful for. Now it’s April. Oops.
The concepts...
2015-04-10
538 reads
If you’re starting the process of moving your databases in Azure SQL Databast to v12, you need to do one...
2015-04-07
2,074 reads
No. Next question.
Although, that answer can be slightly, ever so slightly, nuanced…
Parameter sniffing is a good thing. But, like a...
2015-04-06 (first published: 2015-03-30)
7,290 reads
One of my favorite events of the year is the SQL Saturday in Silicon Valley. They’ve had four of them...
2015-04-03
607 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