Why Did My Job Fail Anyway?
One of my biggest pet peeves when I check a new SQL Server for a client is the fact that...
2014-03-12
1,070 reads
One of my biggest pet peeves when I check a new SQL Server for a client is the fact that...
2014-03-12
1,070 reads
I wrote the SQLServerCentral question of the day that is live today called Schema & Renaming Fun. Mildly interesting, but looking...
2014-03-12
469 reads
It’s time for T-SQL Tuesday, this month hosted by Michael J Swart, our artistic DBA in the community. I love...
2014-03-11
949 reads
Many people see CXPACKET at the top of their waits and start trying to fix it. I know this topic’s...
2014-03-11
1,622 reads
SQL Job details – The script can be executed across all SQL version from SQL 2000 onwards.
The below are the columns...
2014-03-11
413 reads
SQL Job details – The script can be executed across all SQL version from SQL 2000 onwards.
The below are the columns...
2014-03-11
780 reads
This post has been sitting in the draft folder for way too long, March of last year to be precise....
2014-03-11
1,774 reads
SQLSaturday returns to Houston this year, this time at San Jacinto College on May 10, 2014. That’s the Saturday just...
2014-03-11
399 reads
Recently I was designing a simple Power View report on top of a multi-dimensional SSAS cube. Out of the box,...
2014-03-11
1,007 reads
No, I don’t mean the use of sp_updatestats is not smart. It’s a fine, quick mechanism for getting statistics updated...
2014-03-11
1,127 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