CTE command In Sql Server
Common table expression (CTE):- Common table expression or CTE can be described as the temporary, named record set return by...
2012-01-17
4,996 reads
Common table expression (CTE):- Common table expression or CTE can be described as the temporary, named record set return by...
2012-01-17
4,996 reads
Once again, I’m the moderator for a webinar coming up at the end of the month, on Jan 31, 2012....
2012-01-17
830 reads
Subject: Database Makeover: Renovate Your Data Model
Start Time: Thursday, January 19, 2011 12:00 PM US Central Time (January 19, 2011...
2012-01-17
497 reads
All ColoradoSQL user group meetings start at 5:30 p.m. and provide food and refreshments. There is no cost to attend...
2012-01-17
571 reads
Last week’s resolutions post reminded me that it’s time for another status check on the goals I set for myself...
2012-01-17
830 reads
I found myself perusing an execution plan the other day. I know, big surprise there. This execution plan showed me some interesting things I had never really paid much...
2012-01-17
20 reads
I found myself perusing an execution plan the other day. I know, big surprise there. This execution plan showed me...
2012-01-17
1,252 reads
First, I’d like to wish my readers a very safe, happy and prosperous 2012 (santé, properité, et bonheur). This is...
2012-01-17
1,643 reads
I have been working with SQL Server for quite a few years now, and it still happens quite often that...
2012-01-17
6,391 reads
When creating a subscription in SQL Server sometimes the following error will occur:
The remote server "%s" does not exist, or...
2012-01-17
1,931 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