Getting SQLServers Last Known Good DBCC Checkdb with PowerShell and dbatools
As good SQL Server DBA’s we want to ensure that our databases are regularly checked for consistency by running DBCC...
2017-04-05
663 reads
As good SQL Server DBA’s we want to ensure that our databases are regularly checked for consistency by running DBCC...
2017-04-05
663 reads
In a previous post I showed how easy it is to test your backups using Test-DbaLastBackup
Today I thought I would...
2017-04-05 (first published: 2017-03-22)
1,934 reads
If your server collation is different to your database collation then you may find that you get an error similar...
2017-04-03
672 reads
Whilst I was writing my Test-DbaLastBackup Posts I ran into a common error I get when importing datatables into a...
2017-04-01
1,632 reads
I read a great blog post about answering the question how big is the database using T-SQL on SQL Buffet...
2017-03-29
995 reads
All the good DBAs backup their databases.
A significant amount of SQL DBAs use Ola Hallengrens maintenance solution to do so.
This...
2017-03-29 (first published: 2017-03-18)
3,069 reads
I have written about Test-DbaLastBackup in posts here, here and here. They have been Windows only posts.
With SQL Server vNext...
2017-03-27
354 reads
In a previous post I wrote about how easy it was to restore a whole SQL Servers user databases from...
2017-03-20
1,024 reads
Just a quick post, as much as a reminder for me as anything, but also useful to those that attended...
2017-03-17 (first published: 2017-03-12)
2,699 reads
One of the most visited posts on my blog is nearly two and half years old now – Add User to...
2017-03-16 (first published: 2017-03-06)
1,738 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