The Hidden Price Of Foreign Keys
Foreign key constraints put the “relation” into relational databases. They enforce integrity by requiring that a key value referencing another...
2018-03-05
477 reads
Foreign key constraints put the “relation” into relational databases. They enforce integrity by requiring that a key value referencing another...
2018-03-05
477 reads
One of my clients asked to calculate the DTU’s required for an existing database before migrating to Azure SQL Database. Pricing Azure SQL Database is different from traditional SQL...
2018-03-05
21 reads
One of my clients asked to calculate the DTU’s required for an existing database before migrating to Azure SQL Database....
2018-03-05
626 reads
One of my friend sent an email with the requirement to load balance the traffic coming from application to secondary SQL Server replicas in always on availability group. Read-only...
2018-03-05
22 reads
One of my friend sent an email with the requirement to load balance the traffic coming from application to secondary...
2018-03-05
665 reads
If you are a SQL Server professional and are interested in spending a day with a bunch of other like-minded...
2018-03-02
290 reads
My grandfather used to say, “There’s more than one way to skin a cat.” I always thought it was a...
2018-03-08 (first published: 2018-03-02)
4,804 reads
Hey! Here’s the latest on my YouTube Channel. Click on through and subscribe. I’ll be doing lots of stuff on...
2018-03-02
321 reads
If you encounter the following error trying to access reporting services:
User XXXX does not have required permissions. Verify that sufficient...
2018-03-02
276 reads
I’ve been playing with Data Masker for SQL Server v6 and it’s an interesting product. I like the way it...
2018-03-12 (first published: 2018-03-02)
2,281 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