Jason Brimhall


Blog Post

Short Circuit Events

The predicate order is critical. Having the wrong order can result in not trapping the desired events. I cover the critical nature of predicates in the aforementioned article. At...

2015-10-26

11 reads

Blog Post

Counting Events

This article will show how to implement an XEvent Session that employs the use of the event_counter target that is used for counting events. IN addition, you will be...

2015-10-23

11 reads

Blog Post

Counting Events

After reading through the articles about the pair_matching target (here) and the article on the histogram target (here), this one is...

2015-10-23

606 reads

Blog Post

Histograms and Events

In this article I show how to use and configure the histogram target. In addition, I explain how to get to the data trapped into this target. Lastly, I...

2015-10-22

8 reads

Blog Post

Parsing Matched Events

In this article I will be taking you into the world of the pair_matching target. The pair_matching target should connote that this target works on matching like events into...

2015-10-21

13 reads

Blog Post

Matching Events into Pairs

In this article I will be taking you into the world of the pair_matching target. The pair_matching target should connote that this target works on matching like events into...

2015-10-20

13 reads

Blogs

T-SQL Tuesday #203: Risk and Reward

By

This is timely, as I’m currently on a boat in the Adriatic taking a...

dataMinds Connect 2026 – Slides & Scripts

By

You can find the slides and SQL scripts for my session “Spice up your...

How to Clear the SSMS Cache (SSMS 21 and Later)

By

How to Clear the SSMS Cache (SSMS 21 and Later) Updated...

Read the latest Blogs

Forums

Using CHOOSE()

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Using CHOOSE()

Re-Seeding a Broken Log Shipping Secondary (Without Touching the Primary)

By LukaMK

Comments posted to this topic are about the item Re-Seeding a Broken Log Shipping...

The DBA is Dead! Long Live the !

By Grant Fritchey

Comments posted to this topic are about the item The DBA is Dead! Long...

Visit the forum

Question of the Day

Using CHOOSE()

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