What is the database property “Compatibility Level”
What is the database property Compatibility Level? I don’t get asked to write about specific subjects very often but in...
2015-07-08
678 reads
What is the database property Compatibility Level? I don’t get asked to write about specific subjects very often but in...
2015-07-08
678 reads
I love keyboard shortcuts. I’d rather keep my hands on the keyboard than move back and forth to the mouse....
2015-07-13 (first published: 2015-07-06)
2,778 reads
Blocking and deadlocking are not things you typically want to do deliberately. But sometimes you need to test error handling...
2015-07-07 (first published: 2015-07-01)
2,596 reads
A few months ago I wrote a post about the fact that I had actually submitted a session to PASS...
2015-07-03 (first published: 2015-06-29)
1,713 reads
Earlier this week I was scripting out a table with some legacy columns (InsertDate and InsertBy for example). If you...
2015-06-30 (first published: 2015-06-24)
2,096 reads
I got my first real world experience with a TDE (transparent data encryption) database recently. For those who don’t know...
2015-06-22
924 reads
Recently Adam Machanic (b/t) was telling me about an interesting effect of the top operator. When I asked for an...
2015-06-17
671 reads
Renaming a database isn’t something you do frequently but it does have bit of a gotcha. First of all let’s...
2015-06-15
610 reads
TLDR; Search for and modify the sqlfile.sql file.
During a recent T-SQL Tuesday Boris Hristov (b/t) taught me about SET NOEXEC...
2015-06-23 (first published: 2015-06-11)
3,115 reads
It’s the second Tuesday of the month and that means T-SQL Tuesday time! T-SQL Tuesday is a blog party started...
2015-06-15 (first published: 2015-06-09)
2,333 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