Updated query to view data in the error log
This is one of my favorite scripts. It pulls all of the data from the error log and dumps it...
2018-05-31
382 reads
This is one of my favorite scripts. It pulls all of the data from the error log and dumps it...
2018-05-31
382 reads
I was talking about interviews (although not the job kind) with a friend and it reminded me of the time...
2018-06-15 (first published: 2018-05-30)
2,940 reads
We’ve been doing a fair amount of interviewing recently and one of our big questions is What do you do...
2018-06-08 (first published: 2018-05-28)
4,099 reads
A common misunderstanding is that the CONNECT permission lets you do more than just connect to a database. It doesn’t....
2018-05-23
473 reads
I get to help with technical interviews every now and again, and one of the questions we always ask is...
2018-05-21
519 reads
Impersonation is a highly useful tool in your toolbox. With the EXECUTE AS clause you can allow your stored procedure...
2018-05-16
391 reads
I’ve been blogging for a while now. I’ve thought about blogging quite a bit. I’ve even done quite a few...
2018-05-14
497 reads
You should be able to create a #temp in every session. That’s the idea, right? It’s one of the things...
2018-05-10
1,001 reads
It’s TSQL Tuesday again! This month our host is Riley Major (b/t) and the subject is Giving Back. He’s given...
2018-05-18 (first published: 2018-05-08)
1,821 reads
I’ve really got to make a plan here at some point. So far I’ve been just putting down things as...
2018-05-02
261 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