Complicated linked servers and a bunch of head-desks: T-SQL Tuesday #104
Wayne Sheffield (b/t) is our host this month for the long running blog party (104 months now and running!) started...
2018-08-14
386 reads
Wayne Sheffield (b/t) is our host this month for the long running blog party (104 months now and running!) started...
2018-08-14
386 reads
A while back I was given the advice Move your tabs (Object Explorer etc) to the right side of SSMS....
2018-08-08
303 reads
The other day I was given a truly horribly formatted piece of SQL. Something a bit like this only worse,...
2018-08-06
439 reads
This month’s homework is pretty simple to say, not necessarily easy to do. Set up database mail.
Why database mail?...
2018-08-01
337 reads
Earlier this month Steve Jones (b/t) suggested that it might be helpful if those of us that work in the...
2018-08-13 (first published: 2018-07-30)
1,502 reads
Earlier this month Steve Jones (b/t) suggested that it might be helpful if those of us that work in the...
2018-07-25
241 reads
As always with something like this, I like to start with a definition so we are all starting in the...
2018-07-23
178 reads
Recently someone mentioned the LOADHISTORY option of RESTORE. It’s not horribly hard to find in BOL but it wasn’t the...
2018-07-31 (first published: 2018-07-18)
3,034 reads
Recently I was doing one of Kendra Little’s (b/t) SQL Server quizzes. Specifically the Quiz: COUNT() in SQL Server. As...
2018-07-16
1,092 reads
I have a presentation I do every now again on security basics that I’m actually quite proud of. One of...
2018-08-02 (first published: 2018-07-12)
1,972 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