Get Rid of These 5 T-SQL Bad Habits with SQL Prompt
We all have bad habits. Maybe we eat too many snacks, spend too much time on the couch watching TV,...
2014-01-21
613 reads
We all have bad habits. Maybe we eat too many snacks, spend too much time on the couch watching TV,...
2014-01-21
613 reads
Understanding CXPACKET From the SQL BOL (Books on Line) CXPACKET is defined as Class Exchange Packet and “occurs when trying...
2014-01-21
1,261 reads
Back when I was getting ready to take the plunge and begin consulting I sought advice from a friend who...
2014-01-20
798 reads
I was reading the blog post Time for a Quick Rant by Grant Fritchey (blog|@GFritchey) about people who choose to...
2014-01-20
1,548 reads
This is part of my Powershell Challenge, to learn more about PowerShell (PoSh) using the Learn Windows Powershell 3 in a Month...
2014-01-20
1,141 reads
Just a quick blog post to share a query, which I wrote to monitor availability groups and replicas and the...
2014-01-20
1,831 reads
You’ve watched my video (hopefully) now vote for it! In a previous post I wrote about my Power BI contest...
2014-01-20
705 reads
I saw this as a problem recently from someone and thought it would make a good post. As I was...
2014-01-20
735 reads
I was recently investigating an issue that stemmed from a database being in the recovery_pending state. A quick investigation through...
2014-01-20
848 reads
It’s Monday time for this week’s weekly link round-up. If you want to catch these links “live” (so exciting), follow...
2014-01-20
636 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