T-SQL Tuesday #53: Why so serious
Why so serious? If you ask anyone who knows me they will tell you I’m not a terribly serious person....
2014-04-08
397 reads
Why so serious? If you ask anyone who knows me they will tell you I’m not a terribly serious person....
2014-04-08
397 reads
I had a recent run in with collation problems and it got me started reading. As I read I started...
2014-04-02 (first published: 2014-03-26)
1,745 reads
Microsoft has announced that SQL 2014 was in fact an elaborate April Fool’s joke and that Microsoft intends to move...
2014-04-01
870 reads
Microsoft has announced that SQL 2014 was in fact an elaborate April Fool’s joke and that Microsoft intends to move...
2014-04-01
414 reads
Ever assume that when you don’t specify NULL or NOT NULL on a new column it’s going to allow NULLs?...
2014-03-31
1,046 reads
Ever assume that when you don’t specify NULL or NOT NULL on a new column it’s going to allow NULLs?...
2014-03-31
1,210 reads
I had a recent run in with collation problems and it got me started reading. As I read I started...
2014-03-26
514 reads
I started reading about collations after I had a recent run in with them. As I read I started to...
2014-03-24
646 reads
I started reading about collations after I had a recent run in with them. As I read I started to...
2014-03-24
847 reads
I had a recent run in with collation problems and it got me started reading. As I read I started...
2014-03-19
2,265 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