How to restore MSDB & MODEL database – SQL Server System Databases?
The msdb database is used by SQL Server Agent for scheduling alerts and jobs and by other features such as...
2014-07-14
16,137 reads
The msdb database is used by SQL Server Agent for scheduling alerts and jobs and by other features such as...
2014-07-14
16,137 reads
Photo credit – Jenn and Tony Bot
Sometimes old stuff is just as cool as new stuff. Over the past few years,...
2014-07-11
371 reads
Probably you’ve heard about it already, but a quick post just in case – you can download a 100 or so...
2014-07-11
1,006 reads
On our adventure through the various types of wait statistics we end up at another popular wait type: OLEDB.
In this article we...
2014-07-11
593 reads
Rained as I left (early) for the meeting, confirming again why I always leave early – stuff happens (in Orlando, rain...
2014-07-11
681 reads
Another month another bunch of great presentations. I almost don’t want to do this any more. It’s hard. I sit...
2014-07-11
568 reads
On our adventure through the various types of wait statistics we end up at another popular wait type: OLEDB.
In this...
2014-07-11
3,484 reads
It’s Friday, time to look back at the most popular RealSQLGuy posts of the week. Because it’s Friday and you’re...
2014-07-11
292 reads
With “Matrix Infographic” I simply mean those infographics FiveThirtyEight (site | Twitter), the website of statistic revelation Nate Silver, uses to...
2014-07-11
1,077 reads
If you want to grant a user the ability to create/alter/delete any table, SP, function etc in a database you...
2014-07-10
976 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