Using the PowerShell AST to find a ForEach Method
In dbachecks we enable people to see what checks are available by running Get-DbcCheck. This gives a number of properties including...
2018-08-16
340 reads
In dbachecks we enable people to see what checks are available by running Get-DbcCheck. This gives a number of properties including...
2018-08-16
340 reads
Photo by Farrel Nobel on Unsplash
Welcome to another edition of T-SQL Tuesday!
This T-SQL Tuesday is hosted by Wayne Sheffield ( blog | twitter ) and he has asked...
2018-08-14
231 reads
I like to write Pester checks to make sure that all is as expected! This is just a quick post...
2018-07-25
1,282 reads
in my last post I showed how you can save the results of dbachecks to a database and created a...
2018-06-07 (first published: 2018-05-28)
1,874 reads
I gave a presentation at SQL Day in Poland last week on dbachecks and one of the questions I got...
2018-05-31 (first published: 2018-05-23)
3,071 reads
With the latest release of dbachecks we have added a new check for testing that foreign keys and constraints are...
2018-05-25 (first published: 2018-05-19)
2,374 reads
There was an announcement on the Visual Studio Code blog about the public preview of Live Share. This enables you...
2018-05-17 (first published: 2018-05-08)
2,085 reads
I love showing dbachecks to people. It’s really cool seeing how people will use it and listening to their experiences....
2018-05-15
327 reads
I am working on my dbatools and dbachecks presentations for SQL Saturday Finland, SQLDays, SQL Saturday Cork and SQLGrillen I want...
2018-05-10
376 reads
It’s TSQL Tuesday again! This month our host is Riley Major (b/t) and the subject is Giving Back. He’s given us...
2018-05-08
240 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