Clean out all bad characters from a string.
I have a customer who is having a problem with a load. He is getting a fair number of bad...
2015-03-25
1,107 reads
I have a customer who is having a problem with a load. He is getting a fair number of bad...
2015-03-25
1,107 reads
Recently the last day to submit a session for the 2015 Pass Summit rolled around. I mention this because I...
2015-03-23
701 reads
Most senior DBAs I’ve met shudder when they hear NOLOCK. Ever wonder why? For the same reason they shudder at...
2015-03-18
1,247 reads
Temporary tables are a common enough thing in T-SQL that most of us have probably used them on a fairly...
2015-03-16
674 reads
There are a handful of scripts I use on a regular basis. Adam Mechanic’s (b/t) sp_WhoIsActive, My sp_DBPermissions and sp_SrvPermissions,...
2015-03-11
1,239 reads
A common problem when trying to alter a database (take it offline, add a filegroup, whatever) is that someone else...
2015-03-17 (first published: 2015-03-09)
7,452 reads
I don’t know how to get started.
Pretty simple. There are a number of free blogging sites out there. Personally I...
2015-03-04
673 reads
Every month SQL Judo (Russ Thomas) (b/t) challenges us to do his Monthly DBA Challenge. I’ve decided it would be...
2015-03-02
802 reads
It’s been a while since I posted an updated to usp_DBPermissions and usp_SrvPermissions. Sorry. I got lazy with my posting....
2015-02-25
1,298 reads
Feb 16, 2015
Dear Diary,
A few weeks back I introduced HAL002 to a database managed by some annoying devs. They were...
2015-03-04 (first published: 2015-02-23)
7,518 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