Stranger Danger… The need for trust with constraints
I ran into an issue with errors with an database upgrade running into a violation of a foreign key constraint....
2015-08-13
435 reads
I ran into an issue with errors with an database upgrade running into a violation of a foreign key constraint....
2015-08-13
435 reads
Red Gate Documentation Update
Looks like the rapid release channel now has a great feature for locking database objects that you...
2015-08-12
286 reads
out of memory, argggh!
Am I the only one that has experienced the various out of memory issues with SSMS? Not...
2015-08-11 (first published: 2015-08-05)
3,450 reads
the problem of monster views
I’ve been working with tuning an application that performs a lot of Entity framework calls,...
2015-08-10
1,342 reads
Have never really played around with the option: SET NOEXEC ON
Turns out this can be a helpful way to validate...
2015-08-07
3,625 reads
Working in a development environment, I botched up a restore. After this restore attempt to overwrite my database with the...
2015-08-04 (first published: 2015-07-28)
3,137 reads
Was testing a batch file to add a user to a localdb instance. Assumed that my user as admin on...
2015-07-13
512 reads
Was testing a batch file to add a user to a localdb instance. Assumed that my user as admin on...
2015-07-13
328 reads
I'm excited to see the future of Sql server management studio with release of SQL Management Studio 2015 Preview. http://bit.ly/1LSu0Ek
Two...
2015-07-06 (first published: 2015-06-30)
11,736 reads
I’m excited to see the future of Sql server management studio with release of SQL Management Studio 2015 Preview. http://bit.ly/1LSu0Ek...
2015-06-30
959 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