Clean up all (most) of the orphans on an instance
Recently we have been doing a number of instance moves as part of a large upgrade project. And as anyone...
2015-06-03
1,686 reads
Recently we have been doing a number of instance moves as part of a large upgrade project. And as anyone...
2015-06-03
1,686 reads
I blogged in the past about two simple commands that can be a big help in performance tuning SET STATISTICS...
2015-06-01
635 reads
A question came up at work the other day, mostly as a mind game, but you never know it might...
2015-06-08 (first published: 2015-05-28)
1,861 reads
What?
The default database is one of the options when creating a login in SQL Server. This is the initial database...
2015-05-26
1,091 reads
I do a lot of testing with security in SQL Server. And of course to do a thorough job of...
2015-05-20
717 reads
Ever wanted to put a comment on a table? Or maybe even a column? How about an expiration date on...
2015-05-28 (first published: 2015-05-18)
5,984 reads
I went to a SQL Saturday recently and saw a number of great sessions. If you haven’t been to a...
2015-05-14
616 reads
If a user is going to call me about problem, I’d much rather know about it ahead of time. In...
2015-05-21 (first published: 2015-05-12)
4,904 reads
As you may know I’m preparing to write my first presentation. I have a great abstract and an outline of...
2015-05-06
555 reads
The other day Tom Roush (b/t) and Tim Radney (b/t) were having a discussion on twitter about using scheduled windows...
2015-05-14 (first published: 2015-05-04)
6,508 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