Generate a random number of children for each parent
I was asked an interesting question the other day.
Is it possible to get a different random number of rows...
2018-10-17 (first published: 2018-10-03)
2,065 reads
I was asked an interesting question the other day.
Is it possible to get a different random number of rows...
2018-10-17 (first published: 2018-10-03)
2,065 reads
On a previous post, we discussed what is an extended event (XE) and how to create one.
With the following T-SQL...
2018-10-03
289 reads
PowerBI is a powerful reporting solution for Business Intelligence for analytical reports, it is not meant to replace SSRS, the...
2018-10-16 (first published: 2018-10-03)
3,022 reads
Azure Data Factory V2 allows developers to branch and chain activities together in a pipeline. We define dependencies between activities as...
2018-10-16 (first published: 2018-10-03)
1,862 reads
As with most of my posts of late all examples here are using the StackOverflow SQL Server database that can...
2018-10-02
243 reads
As with most of my posts of late all examples here are using the StackOverflow SQL Server database that can...
2018-10-02
128 reads
As part of my job I manage a bunch of SQL instances for Development and Test.
Access is managed though Active...
2018-10-15 (first published: 2018-10-02)
2,342 reads
Is your company working on ways to become more environmentally friendly? Taking care of the environment is an important topic,...
2018-10-02
224 reads
Have you ever wanted SSMS to start and automatically and establish a connection to your DBA \ hub server and have...
2018-10-15 (first published: 2018-10-02)
7,865 reads
This week I had the opportunity to learn about dashboards, reports, and datasets in Power BI using the best kind...
2018-10-11 (first published: 2018-10-02)
3,002 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