Effects of sp_rename on Stored Procedures
There comes a time when mistakes are made. Sometimes those mistakes can be as annoying as a spelling mistake during the creation of a stored procedure. When a mistake...
2014-08-14
19 reads
There comes a time when mistakes are made. Sometimes those mistakes can be as annoying as a spelling mistake during the creation of a stored procedure. When a mistake...
2014-08-14
19 reads
There comes a time when mistakes are made. Sometimes those mistakes can be as annoying as a spelling mistake during...
2014-08-20 (first published: 2014-08-14)
13,835 reads
I’m excited to able to say that I’ve been given the opportunity to put on a full day workshop at...
2014-08-14
818 reads
I had the opportunity to write another guest post at SQL Authority:
Finding Out What Changed in a Deleted Database
This one...
2014-08-14
1,364 reads
Tuesday we sent our metronomic email of the week. No huge call to action this week. My schedule called for...
2014-08-14
800 reads
When creating time calculations in Analysis Services you may take several approaches. For people that have just begin learning SSAS...
2014-08-14
1,613 reads
When creating time calculations in Analysis Services you may take several approaches. For people that have just begin learning SSAS...
2014-08-14
652 reads
If you have worked with SQL Server for very long you have probably run across the extremely useful system function...
2014-08-14
1,515 reads
With IN clause, we can specify multiple values in a WHERE clause.
For example, in case of "IN", one can use...
2014-08-14
1,043 reads
About a year and a half ago, I approached Guy and asked him if he wanted to start a podcast...
2014-08-14
1,411 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