Test your UPDATEs and DELETEs before you run them
This isn’t so much of a best practice, it comes more under the heading of being careful. Let’s say you...
2015-02-18
2,239 reads
This isn’t so much of a best practice, it comes more under the heading of being careful. Let’s say you...
2015-02-18
2,239 reads
Nov 12, 2014
Dear Diary,
They asked for help again. Every now and again everything slows down and they see a lot...
2015-02-26 (first published: 2015-02-16)
8,774 reads
When I decided on security as my topic for February’s T-SQL Tuesday blog party my thought was that security was...
2015-02-12
924 reads
So I’m hosting T-SQL Tuesday this month and decided that since security is something everyone has to deal with it...
2015-02-19 (first published: 2015-02-10)
7,231 reads
T-SQL is not the best language in the world for formatting strings. It can be done, but typically you are...
2015-02-16 (first published: 2015-02-05)
6,295 reads
Come on down! You’re the next contestant on T-SQL Tuesday! I’m your host Kenneth Fisher and this month I’d thought...
2015-02-03
931 reads
Back in December I had the thought that it would be fun to do an email interview with someone. As...
2015-02-06 (first published: 2015-01-28)
6,836 reads
Every month SQL Judo (Russ Thomas) (b/t) challenges us to do his Monthly DBA Challenge. I’ve decided it would be...
2015-01-29 (first published: 2015-01-26)
6,310 reads
Have you ever seen a constraint with a name like PK__TableNam__EA185FBF8FF1529D? It’s kind of funny looking right? I mean it...
2015-01-21
1,947 reads
EXCEPT and INTERSECT are two uncommon commands. Not that they do anything odd but they aren’t exactly well known in...
2015-01-23 (first published: 2015-01-19)
8,662 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