You can’t use GO in dynamic SQL.
This is one of those things that when I look back on it seems really obvious. Note: If at the ... Continue reading
2022-02-10
26 reads
This is one of those things that when I look back on it seems really obvious. Note: If at the ... Continue reading
2022-02-10
26 reads
I haven’t been blogging as much recently as I’d like and I’m trying to get back into it. One excellent ... Continue reading
2022-02-09
15 reads
Well, it’s a new year and a new start, even if I am a bit behind the start of the ... Continue reading
2022-02-02
9 reads
No matter where you are in the world the last couple of years have been, shall we say, difficult. More ... Continue reading
2022-01-07 (first published: 2021-12-30)
217 reads
No matter where you are in the world the last couple of years have been, shall we say, difficult. More ... Continue reading
2021-12-30
10 reads
Something I’ve been thinking about recently is that DBAs are best when they are invisible. Now, this is also true ... Continue reading
2021-12-15 (first published: 2021-12-07)
371 reads
I can only speak for the locations I’ve worked at of course, but in all of the places I’ve worked ... Continue reading
2021-12-10 (first published: 2021-12-02)
315 reads
Something I’ve been thinking about recently is that DBAs are best when they are invisible. Now, this is also true ... Continue reading
2021-12-07
12 reads
I’m feeling a bit uninspired this week, and I plan on only doing one post this week, so I figured ... Continue reading
2021-12-03 (first published: 2021-11-23)
910 reads
I can only speak for the locations I’ve worked at of course, but in all of the places I’ve worked ... Continue reading
2021-12-02
17 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