SSMS regular expressions: format text into a block
Sean’s RegEx for DBAs class must be finally sinking in for me. Today I was able to figure out a...
2015-04-07
516 reads
Sean’s RegEx for DBAs class must be finally sinking in for me. Today I was able to figure out a...
2015-04-07
516 reads
As I mentioned in my original post, Exploring Excel 2013 as Microsoft’s BI Client, I will be posting tips regularly...
2015-04-07
883 reads
I’ve been responsible for administering Analysis Services (SSAS) on a regular basis for the past 7-8 years via SQL Server...
2015-04-07
830 reads
In the first 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...
2015-04-07
19 reads
In the first article on this topic (which can be read here), I discussed the problem of having a database...
2015-04-15 (first published: 2015-04-07)
4,760 reads
If you’re starting the process of moving your databases in Azure SQL Databast to v12, you need to do one...
2015-04-07
2,074 reads
Microsoft has given us DBAs/Developers/etc. a wealth of free reports integrated into SQL Server Management Studio (SSMS) in order to...
2015-04-07
816 reads
Would your coworkers know how to handle your job if you weren’t there?
This question was top-of-mind for me last week...
2015-04-07
1,107 reads
I recently finished the book Now You See It: Simple Visualization Techniques for Quantitative Analysis by Stephen Few of Perceptual...
2015-04-17 (first published: 2015-04-07)
7,450 reads
Following on from my previous post about parsing XML where I used the information from Steve Jones blog post to...
2015-04-07
790 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