PASS Summit and Redgate Software
Next week is the PASS Summit. I’m so excited about it I could pop. Part of why I’m excited is...
2017-10-25
323 reads
Next week is the PASS Summit. I’m so excited about it I could pop. Part of why I’m excited is...
2017-10-25
323 reads
T-SQL provides lots of functions that help to make data entry through T-SQL much more powerful. Over time you won’t...
2017-10-23 (first published: 2017-10-11)
1,887 reads
I’ve said it before, but I feel I should repeat myself. Using the SSMS GUI for data entry and data...
2017-10-16
583 reads
In the previous Database Fundamentals, I argued that you should be learning T-SQL, yet the very next post I’m showing...
2017-09-25
518 reads
If you’ve been following along with the previous 10 Database Fundamentals blog posts, you have a SQL Server installed and...
2017-09-21 (first published: 2017-09-18)
1,985 reads
I am quite honored to say that I am speaking at the single largest and most important Microsoft Data Platform...
2017-09-19
444 reads
Schemas are a very useful tool for managing the objects in your database. From security through process, through placement, schemas...
2017-09-14 (first published: 2017-09-06)
2,310 reads
If you’re going to be in the San Francisco area in October, let’s get together and talk. I’ll be at...
2017-09-13
348 reads
Invariably, either while building a new database, or while maintaining old ones, you will find that the business needs change...
2017-09-12
441 reads
Capturing query execution metrics is much easier now that you can see the runtime metrics in execution plans when you’re...
2017-09-06 (first published: 2017-08-22)
1,612 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