Explicitly Drop Temporary Tables Or Wait For Cleanup?
I was recently asked if we are going to see performance differences if we explicitly drop temporary tables. I couldn’t...
2018-11-07 (first published: 2018-10-29)
3,998 reads
I was recently asked if we are going to see performance differences if we explicitly drop temporary tables. I couldn’t...
2018-11-07 (first published: 2018-10-29)
3,998 reads
Honestly, that’s a very hard question to answer. I mean, first of all, you can look at the schedule. There...
2018-11-05
208 reads
I was recently asked if we could tell why a plan was removed from cache. If you read this blog,...
2018-10-26 (first published: 2018-10-22)
1,908 reads
Using the appropriate data type to avoid conversions or implicit conversions is a fundamental approach to good T-SQL coding practices....
2018-10-24 (first published: 2018-10-15)
1,814 reads
The last Database Fundamentals post introduced the SELECT and FROM commands. We’re going to start using JOIN operations shortly, but...
2018-10-22 (first published: 2018-10-08)
2,971 reads
At a recent all-day seminar on query performance tuning I was asked a question that I didn’t know the answer...
2018-10-10 (first published: 2018-10-01)
2,727 reads
If you’re watching Microsoft Ignite or tracking the information coming out of it on social media, then you know that...
2018-10-02 (first published: 2018-09-24)
3,575 reads
One complaint I’ve received frequently is that you can’t see stored procedure parameter values in Extended Events. That is patently...
2018-09-24
507 reads
Four years ago, after a bunch of dithering and some negotiations with Tony Davis, my editor, I started to update...
2018-09-21 (first published: 2018-09-12)
1,899 reads
While all plans are estimated plans, there is still a difference between capturing an estimated plan and looking at a...
2018-09-20 (first published: 2018-09-10)
1,770 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