Who are the sysadmins in this sql server?
Here’s a quick query that you can run to find out the users with sysadmin fixed server role. Sysadmins have a...
2012-04-24 (first published: 2012-04-23)
33,116 reads
Here’s a quick query that you can run to find out the users with sysadmin fixed server role. Sysadmins have a...
2012-04-24 (first published: 2012-04-23)
33,116 reads
There are few memes going around in the SQL world. Probably the most popular of them is TSQL Tuesday (#tsql2sday)....
2012-04-16
1,802 reads
There are situations where you need to grant SELECT permission to a particular user and limit that access to a...
2012-04-11
2,527 reads
The role of the database professional is quickly evolving to conform with the ever changing demands of the business world....
2012-04-04
1,229 reads
Your ability to document thoroughly will determine your efficiency and productivity when it comes to managing your SQL Server databases....
2012-03-29
2,752 reads
I am looking for a change. Yes, a change. This is the beginning of that quest. This blog will be...
2012-03-28
844 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