Getting and storing a high precision datetime
Earlier today I was working on a project where I was recording some time stamps. In order to get as...
2015-08-13
592 reads
Earlier today I was working on a project where I was recording some time stamps. In order to get as...
2015-08-13
592 reads
Our subject for this month’s T-SQL Tuesday blog party (#69) is Encryption, hosted by a guy with an awesome first...
2015-08-11
818 reads
As you may have noticed if you read my blog I learn a lot from trolling various forums. In this...
2015-08-05
1,306 reads
I decided I’d have some fun today. So for your entertainment here is my first crossword puzzle. (Word and PDF...
2015-08-03
963 reads
I love keyboard shortcuts. I recently mapped a keyboard shortcut to Change Connection and thought I would share some of...
2015-07-29
1,280 reads
I’ve been doing a lot of research recently for my permissions session and for a project at work. During said...
2015-07-27
1,425 reads
Last year Kirsten Benzel(b/t) and Argenis Fernandez(b/t) did this amazing thing. They organized a campaign and raised over $13,000 for...
2015-07-22
691 reads
A few weeks ago I saw a tweet about Kendra Little’s (b/t) new SQL Server Quizzes. Of course I had...
2015-07-24 (first published: 2015-07-20)
2,185 reads
Yes, you heard me right. SSMS 2015. No I’m not one of those crazy recruiters who keep asking for 10...
2015-07-16
996 reads
It’s T-SQL Tuesday again and this month Andy Yun (b/t) is our host and he has asked us to “Just...
2015-07-21 (first published: 2015-07-14)
1,448 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