How to kill a negative SPID (like SPID -2 or -3) in SQL Server?
Today, I face issue during one database restore. I am not able to restore because “Database is in use, Not...
2014-08-25
7,561 reads
Today, I face issue during one database restore. I am not able to restore because “Database is in use, Not...
2014-08-25
7,561 reads
This is a quick demo of a little “trick” with heaps I’ve known about for a couple of years. However...
2014-08-25
622 reads
I assume that by now you’ve tried the script from Part 1, and have seen how easy it is to...
2014-08-29 (first published: 2014-08-25)
6,950 reads
Now that I’ve finally started a new job (explains why I haven’t blogged for a while) I can discuss my...
2014-08-25
393 reads
This is the second post in my series on parameterization. In the first post I wrote about plan caching and...
2014-08-28 (first published: 2014-08-25)
9,145 reads
I received some great news this week, my session about wait statistics is selected for SQLSaturday #336 in Utrecht, Holland!
This...
2014-08-23
715 reads
On August 12th, 2014, another infamous ‘patch-Tuesday,’ Microsoft released a series of Security Updates for multiple versions of SQL Server,...
2014-08-22
2,024 reads
Photo credit – Mike Lynch
A good cure to a creepy doll is a good old post that is still useful. In...
2014-08-22
1,024 reads
I just checked in again on our LinkedIn campaign, had a couple days with good impression counts. We can still...
2014-08-22
492 reads
A few friends challenged me yesterday, including Grant Fritchey and Aaron Bertrand. Last night, when I got to the Denver...
2014-08-22
1,316 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