How do I look at my error log if SQL won’t open?
Quick and easy post today. Hopefully you’ve opened the error log on a SQL instance. However, what happens if you...
2018-10-31 (first published: 2018-10-22)
2,648 reads
Quick and easy post today. Hopefully you’ve opened the error log on a SQL instance. However, what happens if you...
2018-10-31 (first published: 2018-10-22)
2,648 reads
For a long time there I would see the Object Explorer Details tab show up when I opened SSMS (SQL...
2018-10-17
288 reads
I’ve been using sp_spaceused a lot recently so I thought I would bring it up again. Basically it’s a quick...
2018-10-15
234 reads
If you’ve done much with IN (list) then you’ve realized that it basically translates out to
col=val1 OR col=val2 OR...
2018-10-11
2,489 reads
Before I start anything I want go give a disclaimer. I absolutely believe that the business should be involved in...
2018-10-09
229 reads
I was asked an interesting question the other day.
Is it possible to get a different random number of rows...
2018-10-17 (first published: 2018-10-03)
2,065 reads
When you created your home lab last September you probably installed a version of SQL 2016. Well, SQL 2017 was...
2018-10-01
313 reads
Just for fun here is a word search with all of the data types available in SQL Server. Well, two...
2018-10-05 (first published: 2018-09-26)
1,837 reads
No, I’m not talking about that nightmare everyone has where a bunch of strings are chasing you across a loom.
Not...
2018-09-24
894 reads
Did you know you can’t do this?
DELETE TOP (10)
FROM SalesOrderDetail
ORDER BY SalesOrderID DESC;Msg 156, Level 15, State 1, Line 8
Incorrect...
2018-09-27 (first published: 2018-09-19)
3,218 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