Table Hierarchy updated
Recently a need resurfaced to explore the foreign key tree (hierarchy/genealogy) as it related to a specific table within a database. As I pulled out the script from the...
2014-01-21
11 reads
Recently a need resurfaced to explore the foreign key tree (hierarchy/genealogy) as it related to a specific table within a database. As I pulled out the script from the...
2014-01-21
11 reads
Recently a need resurfaced to explore the foreign key tree (hierarchy/genealogy) as it related to a specific table within a...
2014-01-21
851 reads
Taking responsibility for your professional development and making it a priority is essential to being a successful Data Professional. It’s...
2014-01-21
974 reads
Pricing for Power BI for Office 365 has been announced (see pricing).
It’s all very confusing to me but Melissa Coates does a...
2014-01-21
772 reads
Just announced on Friday, SQLSaturday #300 will be held in Kansas City, MO, on September 13, 2014 . Everything about that...
2014-01-21
486 reads
I looked at Outlook.com when it launched and recently revisited. I connected a couple of my personal email accounts to...
2014-01-21
540 reads
Three years ago in March of 2011, on a whim, I jumped into a hole in a frozen lake into...
2014-01-21
605 reads
For the past year or so I’ve hosted this blog at Godaddy using their web hosting service. It took a...
2014-01-24 (first published: 2014-01-21)
1,607 reads
We are awaiting Polar Vortex 2 in New England and are set to have more snow dumped on us starting...
2014-01-21
1,082 reads
(Be sure to checkout the FREE SQLpassion Performance Tuning Training Plan, where you are getting week by week via email...
2014-01-27 (first published: 2014-01-21)
4,275 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