DBA Myths: CHECKDB runs on startup.
If you look at your error log you’ll (hopefully) see entries like this shortly after the instance startup: CHECKDB for ... Continue reading
2019-09-30 (first published: 2019-09-16)
586 reads
If you look at your error log you’ll (hopefully) see entries like this shortly after the instance startup: CHECKDB for ... Continue reading
2019-09-30 (first published: 2019-09-16)
586 reads
I recently found this DMV and couldn’t wait to share. sys.dm_server_services What’s so great about it? For each service for ... Continue reading
2019-09-23 (first published: 2019-09-12)
1,039 reads
It’s fantasy football time again? Oh, fantasy feature? Oh, yea, that makes a lot more sense for #tsql2sday. What’s #tsql2sday? ... Continue reading
2019-09-19 (first published: 2019-09-10)
531 reads
TL;DR; Final query is at the bottom. Every now and again (particularly when someone is having performance problems) I’ll get ... Continue reading
2019-09-04
207 reads
Everything else aside two of the most important tasks of a database are to get data in, and get data ... Continue reading
2019-09-02
248 reads
I recently had someone tell me, and I’m paraphrasing a bit here: We know how to fix this now, so ... Continue reading
2019-08-28
164 reads
If you can help it you probably shouldn’t be using triggers. But if you have to use a trigger you ... Continue reading
2019-09-09 (first published: 2019-08-26)
547 reads
If you started out as a developer you were probably taught how important loops are. They are one of the ... Continue reading
2019-09-02 (first published: 2019-08-22)
1,242 reads
7 years ago today I posted my very first blog post and I’ll tell you it’s been a heck of ... Continue reading
2019-08-20
23 reads
Occasionally I’ve seen date and time stored separately as integers. This had some practical applications back before we had date ... Continue reading
2019-08-27 (first published: 2019-08-15)
796 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