How To: XEvents as Profiler
Despite the controls in place there always seems to be some change that is unknown or even some cowboy that makes changes as s/he sees fit and forgets to...
2018-12-25
21 reads
Despite the controls in place there always seems to be some change that is unknown or even some cowboy that makes changes as s/he sees fit and forgets to...
2018-12-25
21 reads
This is a very simple introduction into the creation of an Extended Event session using a template for Azure SQL DB. I demonstrate the use of the GUI to...
2018-12-24
24 reads
We have all run into a need or a desire to clean up old stale files from the file system, whether it be to remove old backup files or...
2018-12-21
34 reads
There is plenty of legislation and regulation in place these days that strongly suggest the encryption of data within a database. In SQL Server, we have the ability to...
2018-12-20
20 reads
There is plenty of legislation and regulation in place these days that strongly suggest the encryption of data within a...
2018-12-20
400 reads
Recently a friend by the name of Chris Bell (blog | twitter) wrote about an easy way to disrupt SQL Server....
2018-12-20 (first published: 2018-12-03)
3,602 reads
Loads of TSQL Tuesdays
Years ago the TSQL Tuesday party was started by Adam Machanic (b|t). The premise of the monthly event...
2018-12-19
236 reads
I have personally participated in quite a large number of these TSQL Tuesday events - despite not being every single one. This is a roundup of my personal participation...
2018-12-19
13 reads
Small tokens of gratitude and small actions help to build this wonderful SQL Community that gives and gives and gives. Humility leads us to seek out ways to give...
2018-12-18
13 reads
How have you impacted somebody in the community?
This month I am in charge of the topic for TSQLTuesday. The invite...
2018-12-18
231 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