Natural vs Artificial Primary Keys
There has been a long standing debate over the use of a natural primary key vs an artificial one. I...
2016-08-29
1,299 reads
There has been a long standing debate over the use of a natural primary key vs an artificial one. I...
2016-08-29
1,299 reads
Continuing my exploration of Azure the next logical step seemed to be copying an on-premise database up to the cloud....
2016-09-06 (first published: 2016-08-24)
1,840 reads
In case you hadn’t noticed I’ve recently started looking at the cloud and what it entails. Well one of those...
2016-08-22
661 reads
Many years ago Jeff Moden (of SQL Server Central fame) came up with the concept of RBAR. Row-By-Agonizing-Row. At it’s...
2016-08-25 (first published: 2016-08-17)
2,727 reads
Possibly the single most influential event in my career happened over 25 years ago. I lost my temper at a...
2016-08-15
1,059 reads
Yep, that’s right, you heard me. Write-Only not Read-Only. I was presenting SQL Server Security Basics at NTSSUG the other...
2016-08-11
617 reads
If you want to blog T-SQL Tuesday is a great way to get started. On the first Tuesday of each...
2016-08-09
606 reads
A DBA walked into a bar, saw a couple of tables, and asked “Can I JOIN you?”
There are several different...
2016-08-03
1,296 reads
I use impersonation on a regular basis for a number of different tasks. This one is pretty basic but can...
2016-08-03 (first published: 2016-08-01)
2,036 reads
I frequently need to know where backups went and I restore those backups for operational recovery on a regular basis....
2016-07-27
858 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