Blogger questions: What if someone else wrote about the same subject?
I have a moderately popular blog. In part because I syndicate but largely (in my opinion) because I write a...
2016-02-03
569 reads
I have a moderately popular blog. In part because I syndicate but largely (in my opinion) because I write a...
2016-02-03
569 reads
Every now and again you need to run code when your instance starts up. For example you might want to...
2016-02-08 (first published: 2016-02-01)
1,478 reads
The CONNECT permission exists at the instance and database levels. Note: as of SQL 2012 it is CONNECT SQL at...
2016-02-03 (first published: 2016-01-27)
3,442 reads
I’m a big fan of automation. You get it written, tested, and scheduled, then you just sit back and monitor...
2016-02-01 (first published: 2016-01-25)
1,513 reads
tl;dr; Re-start the instance in safe mode (-f startup parameter) and move tempdb. Then re-start without the parameter.
While at the...
2016-01-20
10,684 reads
To the page
It’s not one of those things you have to do frequently but every now and again you need...
2016-01-18
548 reads
I was reading some code the other day and it included the statement RESULT SETS. I’d never seen it before...
2016-01-26 (first published: 2016-01-14)
8,294 reads
TSQL Tuesday #74: Be The Change
Each month, on the first Tuesday of the month, the announcement for the blog...
2016-01-18 (first published: 2016-01-12)
1,542 reads
MSDTC is frequently required when using transactions within SSIS. And not just when you are connecting to two SQL Server...
2016-01-12 (first published: 2016-01-06)
3,773 reads
It’s a new year, so time to look back at the previous year, and forward to the next. I’ll tell...
2016-01-04
445 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