I am a Superhero
Two weeks ago I attended SQLBits in London. This is probably the biggest SQL Server conference in Europe, and this...
2015-03-25
617 reads
Two weeks ago I attended SQLBits in London. This is probably the biggest SQL Server conference in Europe, and this...
2015-03-25
617 reads
Last year I purchased a Lenovo W530. Nightmares then ensued. Nice laptop if you just want to use it as...
2015-03-25
620 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
How many times have you said to yourself, “Someone should build an application that does [x]…”, or “Wouldn’t it be...
2015-03-25
784 reads
I am an IT Professional from the UK with a huge interest in MS technology especially SQL Server and Azure. During...
2015-03-25
316 reads
I like to initialize my arrays by strongly typing my variable as an array, and setting it to null. PowerShell...
2015-03-24
691 reads
The question was this:
This is just a quick/fast snippet in response to that question, but I can think of a...
2015-03-24
473 reads
Saw this on twitter and thought I would throw it up on the blog. Easier than responding on twitter.
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null;
$SQLServerInstance...
2015-03-24
414 reads
My cheap and dirty PowerShell script for dumping the disk space usage for a Windows machine. It was originally some...
2015-03-24
472 reads
I’ve been a problem solver as far back as I can remember, always looking for a new challenge. I love...
2015-03-24
266 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