Speaking Engagements
It only seems like a couple of weeks ago since I wrote a post about new years resolutions which you...
2011-11-15
525 reads
It only seems like a couple of weeks ago since I wrote a post about new years resolutions which you...
2011-11-15
525 reads
A couple of interesting developments this week. First, Intel has officially released (and lifted the embargo) on their new high-end,...
2011-11-15
852 reads
Sometimes it’s not possible to have the data you need in order to create the most efficient queries possible. This...
2011-11-15
709 reads
The lineup for SQLInspire
I spoke at the SQL Inspire event this last weekend and it was a greart experience. This...
2011-11-14
1,504 reads
In SQL Server 2005 and later, there is a database option called “forced parameterization”. When it is turned on, it...
2011-11-14
798 reads
The DBA in Space contest ends November 18, 2011. If you haven’t entered yet, you still have time.
Filming DBA in...
2011-11-14
734 reads
In IT, we have a few very solid and universal principles that no one ever argues with. The first of...
2011-11-14
581 reads
Last week my partner in crime, Bobby Dimmick (blog | twitter) and I sat down for lunch and caught up and...
2011-11-14
1,675 reads
In SSAS, data structures do not always conform to the snowflake or star schema model where one fact is associated...
2011-11-14
1,519 reads
When creating a SSRS report, you want to add lines that display trends. Sparklines that were introduced in SQL Server 2008 R2...
2011-11-14
3,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