Talk To Me At PASS Summit 2019
I say this all the time, but shockingly few people take advantage. Say hi to me. Please. I’m going to be at PASS Summit next week. I’ll be presenting...
2019-11-01
22 reads
I say this all the time, but shockingly few people take advantage. Say hi to me. Please. I’m going to be at PASS Summit next week. I’ll be presenting...
2019-11-01
22 reads
I’ve had the opportunity in the last month to do a couple of different consulting visits, one private and one through my employer, Redgate. The goals of each of...
2019-10-28
23 reads
This week Grant muses on how history can impact our decisions moving forward, and having a little empathy can be useful when re-examining the past.
2019-10-26
208 reads
Those my friends are, in my opinion, one of the single most wonderful things on earth, white chocolate macadamia nut cookies. Now, you may not like those. So, picture...
2019-10-23
109 reads
If you’ve been reading these Database Fundamentals posts, you’ve already seen the WHERE clause because of your use of it when manipulating data with DELETE and UPDATE statements. It’s...
2019-10-21 (first published: 2019-10-14)
626 reads
My great organization, Redgate, is doing things a little different this year at PASS Summit. Instead of hosting our own event, we’ve decided to host a pre-con at the...
2019-10-08
58 reads
I’ve been teaching a lot more about SQL Injection lately (including blog posts). I’ve been doing this because, despite this being a 21 year-old problem with well defined solutions,...
2019-10-07
189 reads
While the CROSS JOIN is not used much, and, depending on the size of your data it can be dangerous, there are some uses for it. For example, you...
2019-10-03 (first published: 2019-09-23)
1,045 reads
Today Grant reminds us to not only think about the things we can do better, but remember the good things that we accomplish.
2019-09-28
245 reads
I’ve received several notes of thanks over the last couple of weeks. I’m not sure exactly what’s prompted this sudden outpouring because it’s all been about stuff I’ve done...
2019-09-27
41 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