I may need to re-think the use of table variables
Table variables have been fixed in SQL 2019, so now I have to decide if I will use them again.
2024-07-26 (first published: 2018-12-11)
387 reads
Table variables have been fixed in SQL 2019, so now I have to decide if I will use them again.
2024-07-26 (first published: 2018-12-11)
387 reads
I recently changed jobs and my commute time doubled, I found myself with more time to think and I started asking questions.
2023-09-11 (first published: 2016-10-10)
270 reads
In today's guest editorial: the motivation to do our best must come from within.
2023-04-07 (first published: 2017-02-17)
267 reads
Is the stuff we do in our off hours truly relaxing or just taking up time?
2022-12-09 (first published: 2017-03-31)
246 reads
2022-09-26 (first published: 2018-03-16)
440 reads
Audit systems can be a good idea, but they can also be a mess to maintain.
2022-05-30 (first published: 2018-02-27)
398 reads
2022-05-16 (first published: 2018-01-15)
366 reads
Using a list to keep track of what you should work on is only as good as the plan or goal behind it.
2021-10-15 (first published: 2017-08-07)
287 reads
Today we have a guest editorial as Steve is traveling. Ben Kubicek notes that sometimes it is hard for technical people to communicate well.
2021-03-03 (first published: 2016-09-08)
243 reads
2021-01-19 (first published: 2018-01-23)
433 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