Hugo’s SQL Server Execution Plan Reference
I’m a big fan of T-SQL Tuesday. Each month there is a host who comes up with a topic, and...
2019-03-18
453 reads
I’m a big fan of T-SQL Tuesday. Each month there is a host who comes up with a topic, and...
2019-03-18
453 reads
And if you are still reading you probably fit into one of the following categories.
Not a DBAA relatively new DBALike...
2019-03-27 (first published: 2019-03-14)
870 reads
This month our intrepid host for T-SQL Tuesday is Shane O’Neill (b/t). He’s asked us to talk about our cookies....
2019-03-12
260 reads
I tend to feel that a lot of people who use triggers don’t really understand them. That said, every now...
2019-03-20 (first published: 2019-03-06)
3,284 reads
You’ve heard of tempdb right? It’s one of the system databases. All of the system databases are important but poor...
2019-03-15 (first published: 2019-03-04)
2,428 reads
Dem queries, dem queries, dem slow queries,
Dem queries, dem queries, dem fast queries,
Dem queries, dem queries, dem big queries,
Now write...
2019-02-27
1,155 reads
So I was trying to work on a blog post about the new truncation error this morning and realized I...
2019-02-25
249 reads
Ever looked at the list of databases and wonder why you own one of them? Or why some other user...
2019-02-20
147 reads
There are a lot of reasons to write a blog post. One of my favorites is when I’ve been asked...
2019-02-18
195 reads
The thing about DBA Myths is that they are generally widespread and widely believed. At least I believed this one...
2019-03-04 (first published: 2019-02-14)
2,462 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