Get Information on Current Traces Running
This is just a quick informational query to save as a snippet to get some quick information on running traces,...
2014-12-02
956 reads
This is just a quick informational query to save as a snippet to get some quick information on running traces,...
2014-12-02
956 reads
I was looking for an efficient way to eliminate overlapping days when provided with a historical table that provided events...
2014-10-16
1,029 reads
If you want to create sample random samples when dealing with date calculations to test your results, you can easily...
2014-08-12
530 reads
Common date values you may need to reference that you may not want to write from scratch each time.
Hope...
2014-08-12
1,057 reads
A step by step explanation on one way to get a consecutive period of months, which could easily be adapted...
2014-05-19
671 reads
Ran across a comment the other day that scalar functions prohibit parallelism for a query when included. I thought it...
2014-02-11
860 reads
If you run across migrating or copying a database structure for some purpose, yet need to change the database references...
2013-08-13
1,940 reads
I’ve never really used the F1 key for help files with most applications. I was surprised at the usefulness in...
2013-07-24
879 reads
If you have a set of columns inside your table that you want to allow nulls in, however if one...
2013-07-18
1,243 reads
When dealing with large amounts of objects in a database, navigation can be tedious with SSMS object explorer. This extender...
2013-07-16
747 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