Synonyms in SQL Server – Good and Bad
When SQL Server 2005 was released, a nifty little feature was included called synonyms. Despite being around since SQL Server...
2018-12-14
305 reads
When SQL Server 2005 was released, a nifty little feature was included called synonyms. Despite being around since SQL Server...
2018-12-14
305 reads
How you use a synonym can be a huge asset or it can be a significant dampener to performance. There are benefits and uses for these nifty little things....
2018-12-14
54 reads
Have you ever taken over a server that had several maintenance plans on it? Have you ever really checked who the owner of those plans is? Or, maybe you...
2018-12-13
57 reads
We all inherit things from time to time through our profession. Sometimes we inherit some good things, sometimes we inherit...
2018-12-13
235 reads
How have you impacted somebody in the community?
Well, have I come up with a doozy of a topic for this...
2018-12-11
201 reads
Getting feedback from others is that little check that is needed to help progress and move in the right direction. When allowing time and opportunity for feedback from others,...
2018-12-11
17 reads
Yes Virginia, there are ghosts in your database. More specifically, there are ghosts in your SQL Server database. They are...
2018-12-10 (first published: 2018-11-26)
2,574 reads
Yoink – Backups Gone
Not only is this mystery of missing backup files worth discussing now, but has been a mystery worth...
2018-12-10
327 reads
Managing database backups is a critical role of the successful DBA. Understanding what the backup plan is and ensuring backups occur on schedule is not always transparent to the...
2018-12-10
8 reads
Despite the controls in place there always seems to be some change that is unknown or even some cowboy that makes changes as s/he sees fit and forgets to...
2018-12-06
111 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