Database Drops in SQL 2012
In the previous article on this topic (which can be read here), I discussed the problem of having a database get...
2015-07-06 (first published: 2015-07-01)
2,081 reads
In the previous article on this topic (which can be read here), I discussed the problem of having a database get...
2015-07-06 (first published: 2015-07-01)
2,081 reads
As we begin to get a grasp of all that is available with SQL Server 2016 and all of the new features, it is a great idea to see...
2015-07-06
39 reads
As we begin to get a grasp of all that is available with SQL Server 2016 and all of the...
2015-07-06
1,272 reads
In the previous article on this topic (which can be read here), I discussed the problem of having a database get dropped and the need to find out who dropped...
2015-07-01
32 reads
Some of the beauty of being a database professional is the opportunity to deal with our friend NOLOCK. For one reason...
2015-06-25 (first published: 2015-06-15)
3,430 reads
This is a post that is looooong overdue. I have intended to write some of this at least since the first SQL Cruise I attended back in 2013 (in...
2015-06-24
21 reads
This is a post that is looooong overdue. I have intended to write some of this at least since the...
2015-06-24
667 reads
Using Extended Events to trap/trace information allows the trapping of that information to various targets. One of the targets I will frequently tell people to use is the file target....
2015-06-21
11 reads
Using Extended Events to trap/trace information allows the trapping of that information to various targets. One of the targets I will...
2015-06-21
1,765 reads
I bring you yet another installment in the monthly meme called T-SQL Tuesday. This is the 67th edition, and this...
2015-06-18 (first published: 2015-06-10)
1,911 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