SQL Server Transactions and Locking (Part 1)
In many situations, data modification requires several steps. For example, you may need to change the values ??in two separate...
2013-05-22
616 reads
In many situations, data modification requires several steps. For example, you may need to change the values ??in two separate...
2013-05-22
616 reads
The well-designed online analytical processing (OLAP) solution is fundamental to organizations analysis capabilities. That is why, when designing the OLAP...
2013-05-22
897 reads
With the release of SQL Server 2005 and later releases, Microsoft introduced set of new dynamic management view and function...
2013-05-22
594 reads
I’m truly honored to be chosen to speak at PASS Summit 2013. The honor is compounded as I have been...
2013-05-22
711 reads
PASS liked our “Mouth Wide Shut” interviewing session from last year so much that they’ve decided to have us back...
2013-05-22
609 reads
Seems I managed to make it through all of April without an update to the index analysis stored procedure. It...
2013-05-22
589 reads
I am beyond excited to announce that I have been accepted to speak at the annual SQL PASS Summit 2013...
2013-05-22
1,188 reads
No, this isn’t some complaint about PASS or the Summit. This is an announcement that not only will I be...
2013-05-22
658 reads
Snippet to quickly view computed column information. You can also view this by doing a “create table” script. This however,...
2013-05-22
585 reads
I’m Speaking at The PASS Summit 2013!
Hello Dear Reader! Big news. I’ve been selected as a speaker for the SQL...
2013-05-22
521 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