Is a SELECT statement always executed?
(Be sure to checkout the FREE SQLpassion Performance Tuning Training Plan - you get a weekly email packed with all the...
2018-08-22
203 reads
(Be sure to checkout the FREE SQLpassion Performance Tuning Training Plan - you get a weekly email packed with all the...
2018-08-22
203 reads
Last month Steve Jones (b/t) suggested that it might be helpful if those of us that work in the IT/database...
2018-09-06 (first published: 2018-08-22)
1,662 reads
Sometimes the SQL logs and application logs provide some great info in regards to errors and issues. When building an...
2018-08-22
5,774 reads
JSON (JavaScript Object Notation) is a file format used to transmit data from various applications, very similar to XML, it...
2018-09-06 (first published: 2018-08-22)
3,737 reads
I’ve had a lot of people ask me for this over the past few months and its finally (mostly) ready!...
2018-09-03 (first published: 2018-08-21)
2,574 reads
This fall, in October, Redgate Software will be hosting three, live, in-person events. These events will take place in New...
2018-09-03 (first published: 2018-08-21)
1,479 reads
Hello Readers,
As per Previous article, i tried to explain configuration of Distributed Cache in SharePoint 2013 environment. Same follows for...
2018-08-21
1,130 reads
SQL server error 5123 occurs when users want to attach the database, which has been placed on different locations. This error is a kind of permission error that occurs...
2018-08-21
97 reads
SQL server error 5123 occurs when users want to attach the database, which has been placed on different locations. This...
2018-08-21
35,375 reads
Watch this week’s episode on YouTube.
Last week I needed to write a recursive common table expression. I’ve written them before,...
2018-09-07 (first published: 2018-08-21)
2,362 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