SQLServerCentral Editorial

It's Never Just One Thing

I was reading about a recent security failure when I saw the phrase "...a series of missed opportunities...". Made me giggle and say to myself "No Kidding Kojak" except I used Sherlock Holmes and a different word. Fact is, security failures, and hey, let's face it, process failures, almost never come down to a single […]

External Article

Simple way to export SQL Server data to Text Files

Since the transition from DTS to SSIS, I have found myself looking for alternative ways to do simple tasks such as exporting data from SQL Server into text files. SSIS is a far more powerful tool than DTS, but I generally try to stay away from it for simple operations. With the combination of a few T-SQL commands this tip shows you a simple way to export data to text files.

SQLServerCentral Editorial

Let's Talk Certifications

In just over a week, I'm going to be in Valencia, Spain, for pgConf.eu. While there, I'm planning to take the first certification to come out of the Open Alliance for PostgreSQL Education. I'm more than a little nervous because I'm not sure I'm ready. However, I've been studying and reading, watching videos, practicing my […]

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