Auditing when Database Files Change
As a Database Administrator, something that should be part of your database audit is monitoring the growth of files. That means tracking when the log file grows and tracking...
2018-11-27
23 reads
As a Database Administrator, something that should be part of your database audit is monitoring the growth of files. That means tracking when the log file grows and tracking...
2018-11-27
23 reads
Yes Virginia, there are ghosts in your database. More specifically, there are ghosts in your SQL Server database. They are not there to haunt you. They are not there...
2018-11-26
14 reads
The other day, I shared an article showing how to audit database offline events via the default trace. Today, I...
2018-11-26 (first published: 2018-11-15)
1,938 reads
Azure Data Studio (ADS) is getting all sorts of love and attention these days. So much so that they have...
2018-11-21
869 reads
Azure Data Studio (ADS) is getting all sorts of love and attention these days. So much so that they have finally gotten around to adding Extended Events (XE) to...
2018-11-21
13 reads
I recently had a client call me out of the blue because he happened to be getting an error while...
2018-11-21 (first published: 2018-11-07)
2,583 reads
There comes a point in one’s career when a change is requisite. Big or small there always seems to be...
2018-11-21 (first published: 2018-11-13)
2,133 reads
Knowing just how long an event takes is a common requirement when troubleshooting. Sometimes, figuring out the unit of time...
2018-11-20
255 reads
Knowing just how long an event takes is a common requirement when troubleshooting. Sometimes, figuring out the unit of time is a bit troublesome. Is it milliseconds, seconds or...
2018-11-20
16 reads
Working with PowerShell brings a lot of advantages and power to help manage a server. The more current your PoSh version, the more efficiently you will be able to...
2018-11-19
27 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