Automation starts by doing something once, very very carefully: T-SQL Tuesday #110
After a while the intros for my T-SQL Tuesday posts get a little boring. So without any further ado, it’s...
2019-01-08
212 reads
After a while the intros for my T-SQL Tuesday posts get a little boring. So without any further ado, it’s...
2019-01-08
212 reads
Happy New Year! Every year for New Years we all make a big deal of coming up with New Years...
2019-01-02
1,078 reads
I’ve just signed up on Microsoft’s new learning opportunity Microsoft Learn. The main categories are Azure, Business Apps, and Windows...
2018-12-31
438 reads
Always be learning right? So when I saw this I had to go HU?! That’s new. What’s going on here?
SELECT
IDENTITY(INT,...
2019-01-02 (first published: 2018-12-19)
7,635 reads
Microsoft does a lot of things to try to help us not shoot ourselves in the foot. This little error...
2018-12-17
1,041 reads
TL;DR; BULK INSERT doesn’t have an easy way to specify a column list so the columns in the insert file...
2018-12-12
1,094 reads
We’ve been doing a lot of upgrading recently and at one point had to move an instance from one 2016...
2018-12-10
240 reads
A co-worker showed me a really neat trick the other day. We deal with a lot of connection problems and...
2018-12-05
7,448 reads
I’ve committed to posting a piece of homework for you to do each month. I post at the beginning of...
2018-12-03
207 reads
I thought I would post this a bit early so everyone can memorize the words before Hanukka starts next week.
I...
2018-12-18 (first published: 2018-11-28)
2,761 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