How Your Hypervisor Can Impact Your CPU
Recently I had a client complain of chronic high CPU utilization. The performance of their SQL Server had degraded, and...
2019-03-06
595 reads
Recently I had a client complain of chronic high CPU utilization. The performance of their SQL Server had degraded, and...
2019-03-06
595 reads
One thing I learned while working as a database administrator over 17 years is the importance of teamwork across departments....
2019-02-27
251 reads
Following up from last week’s post on Azure Key Vault in this blog I will show you how to the...
2019-02-20
242 reads
I am very excited and lucky to be speaking at my very first international conference, SQLBits. SQLBits, the largest SQL...
2019-02-13
192 reads
Keys and secrets (AKA passwords) are an essential part of data protection management not only on-premises, but within the cloud...
2019-02-06
264 reads
Azure offers a lot of value-added services included with the price of what you pay . One of the things really,...
2019-01-30
303 reads
A key part of the SQL Server Agent is the ability to schedule jobs. While you can create one schedule...
2019-02-08 (first published: 2019-01-23)
2,757 reads
We all have written queries that use COUNT DISTINCT to get the unique number of non-NULL values from a table....
2019-01-15 (first published: 2019-01-03)
2,491 reads
Ever need to have a test database on hand that you can allow others to query “real like” data without...
2019-01-02 (first published: 2018-12-19)
2,708 reads
SQL Server Vulnerability Assessment (VA) in SQL Server Management Studio 17.4 or later lets SQL Server scan your databases for...
2018-12-12
327 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