What’s in my backup file?
Restoring a backup file is pretty easy right?
RESTORE DATABASE [Test] FROM DISK = 'C:\backups\backup.bak';Ok, but what if more than one database...
2017-02-22
950 reads
Restoring a backup file is pretty easy right?
RESTORE DATABASE [Test] FROM DISK = 'C:\backups\backup.bak';Ok, but what if more than one database...
2017-02-22
950 reads
Growing up my mother used this phrase quite a bit. Penny wise, pound stupid. (In case you didn’t know the...
2017-02-20
427 reads
I had an interesting problem recently. A database was stuck in single user mode. How exactly was it stuck you...
2017-02-16
1,431 reads
Sometimes you have a requirement to grant permissions to every database on an instance. Historically this has required creating a...
2017-02-14
735 reads
Everyone deals with deadlocks from time to time. But sometimes we need to control who’s the deadlock victim and who...
2017-02-17 (first published: 2017-02-08)
2,919 reads
The SQL Tiger Team (t) has recently put out a guided walkthrough for SQL Connectivity issues.
Announcement
Walk Through
If you look...
2017-02-06
426 reads
When you open SSMS a connection window automatically comes up. Then once you pick your server, connection type, username and...
2017-02-01
795 reads
In case you hadn’t noticed, I love built in help. DBCC HELP, the script button in SSMS, even BOL. Well...
2017-01-30
687 reads
My recent post on why SQL logins aren’t working has generated a couple of follow up posts. The first one...
2017-02-02 (first published: 2017-01-25)
2,391 reads
I recently wrote a blog about how to tell why your SQL login isn’t working. There were a lot of...
2017-01-30 (first published: 2017-01-23)
1,129 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