What is ANSI_NULLS and why will I be glad when it finally goes away?
Recently I wrote about what it means that a value is NULL. Right at the beginning I mentioned ANSI_NULLS and...
2014-08-04 (first published: 2014-07-28)
22,379 reads
Recently I wrote about what it means that a value is NULL. Right at the beginning I mentioned ANSI_NULLS and...
2014-08-04 (first published: 2014-07-28)
22,379 reads
This may seem like a question with a simple answer but there is a bit more to it than you...
2014-07-23
1,728 reads
I seem to get a lot of permissions questions these days and one of the more frequent ones goes along...
2014-07-28 (first published: 2014-07-21)
8,674 reads
When I was in college and taking programming classes (back in the days when “a T-Rex ate my 5.25 inch...
2014-07-22 (first published: 2014-07-16)
9,139 reads
Let’s start by assuming that ANSI_NULLS are ON. If you aren’t sure what ANSI_NULLS are exactly, don’t worry, I’ll be...
2014-07-15 (first published: 2014-07-14)
10,911 reads
If you want to grant a user the ability to create/alter/delete any table, SP, function etc in a database you...
2014-07-10
975 reads
I assume that since it’s the second Tuesday of the month that it’s time for T-SQL Tuesday. And you can...
2014-07-08
853 reads
Early yesterday Kirsten Benzel(b/t) announced something very exciting, at least exciting to me. Argenis Fernandez(b/t) has agreed to wear a...
2014-07-02
700 reads
One of the most powerful tools we have as users of SQL Server is Books Online (BOL). Whether you work...
2014-06-30
4,076 reads
Every now and again you have to put a really long string (more than 8000 characters). Dynamic SQL is the...
2014-06-25
2,642 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