Blogger Questions: What should I blog about?
Over the last four years I’ve blogged almost 400 times. It’s become a refuge, a resource, a source of pride,...
2016-07-25
436 reads
Over the last four years I’ve blogged almost 400 times. It’s become a refuge, a resource, a source of pride,...
2016-07-25
436 reads
When restoring a database there are times when it would nice to restore a bit, check what’s been restored so...
2016-07-20
779 reads
Let’s say your company relies on the cloud for its servers (or maybe not, on premise networks have more options...
2016-07-18
445 reads
Fair warning, this is a discussion piece. I had a task, I went through several possibilities and I’m going to...
2016-07-14
1,053 reads
It’s Chris Yates (b/t) birthday! (I think he just tured 19.) And in honor of his birthday we are writing...
2016-07-12
761 reads
Steve Jones (b/t) has been asking people to post their Pass Summit submissions and the reviews that came back, along...
2016-07-07
451 reads
That SSIS change just won’t stick! There is a new business requirement, so now you have to change an existing...
2016-07-05
1,001 reads
Foreign keys are a classic method of enforcing RI (Referential Integrity). Unfortunately though, they can get in the way if...
2016-07-11 (first published: 2016-06-29)
1,970 reads
Like many other programming languages T-SQL uses parentheses () for a number of tasks. To help determine precedence, function calls etc....
2016-07-05 (first published: 2016-06-27)
2,916 reads
This feature is Enterprise only which can limit who it is useful to, but I find the whole concept fascinating....
2016-06-22
584 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