Transactions: What commands aren’t allowed?
Transactions are great tools that every DBA and developer should learn how to use. Unfortunately not everything can be put...
2014-02-13 (first published: 2014-02-05)
4,567 reads
Transactions are great tools that every DBA and developer should learn how to use. Unfortunately not everything can be put...
2014-02-13 (first published: 2014-02-05)
4,567 reads
If you’re a data warehouse developer, chances are you use T-SQL Merge statement to process slowly changing dimensions. If you’ve...
2014-02-05
1,360 reads
While every organization is different, their “big data” is often very similar. It typically comprises massive amounts of data across...
2014-02-05
413 reads
Wrote this email exchange with some developer colleagues about to embark on performance tuning.
Subject: bag o' tricks from DMV talk
From: A. Developer
Hey...
2014-02-12 (first published: 2014-02-05)
2,091 reads
Inventory is a vital information,whether you’re a consultant or an in-house DBA, you need to have a reliable inventory of...
2014-02-04
2,079 reads
Today John Sterrett (blog | twitter) and I are announcing a new SQL PASS Virtual Chapter dedicated to High Availability and Disaster...
2014-02-10 (first published: 2014-02-04)
1,401 reads
Place Your Bets All bets on the table please. This is the last call for bets, no new bets will be allowed. This marks the 51st invitation for TSQL...
2014-02-04
10 reads
Place Your Bets
All bets on the table please. This is the last call for bets, no new bets will be...
2014-02-07 (first published: 2014-02-04)
2,305 reads
I suspect most DBAs have a script in their T-SQL toolbelt which scripts out database permissions for a specific user...
2014-02-04
1,119 reads
Have you ever had an error when using a SQL Server Proxy Account? I ran across a misleading error. Let...
2014-02-10 (first published: 2014-02-04)
1,891 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