SQL Homework – December 2017 – View the log
Last homework of the year. Last month was to create a view. This month it’s time to take a look...
2017-12-04
317 reads
Last homework of the year. Last month was to create a view. This month it’s time to take a look...
2017-12-04
317 reads
I’ve been writing crosswords for the last few months and to change things up I thought I would do a...
2017-11-29
568 reads
Doing a database restore may not be the most common task a database professional will ever do, but it’s a...
2017-12-07 (first published: 2017-11-27)
7,595 reads
A while back I did a post about why you shouldn’t shrink your data file. This one is going to...
2017-11-20
468 reads
I had someone ask me about this the other day. Specifically getting variable data out of a dynamic SQL statement....
2017-11-16
1,502 reads
Ewald Cress (b/t) is our host this month for Adam Machanic’s (b/t) monthly blog party T-SQL Tuesday. Having just gotten...
2017-11-14
343 reads
I’ve talked about Collation Confusion before. We had the dev and test instances at one collation and the production instance...
2017-11-08
435 reads
It was recently brought to my attention that not everyone knows everything. This was a shock. Everyone is born knowing...
2017-11-06
591 reads
Views are a highly useful tool for abstracting how you see the data stored in tables. At their simplest, they...
2017-11-13 (first published: 2017-11-01)
1,519 reads
Have you ever had a query change performance unexpectedly? Intellisense all of a sudden stops working, or gives inconsistent results?...
2017-10-30
677 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