SQL Agent Job Wrapper Part 3 – Handing the Errors in the Wrapper Script
This is the 3rd installment in a small series of blog posts on how to create a PowerShell wrapper for...
2015-05-26
701 reads
This is the 3rd installment in a small series of blog posts on how to create a PowerShell wrapper for...
2015-05-26
701 reads
What?
The default database is one of the options when creating a login in SQL Server. This is the initial database...
2015-05-26
1,091 reads
By David Postlethwaite
Once you have created your database you can now start to manage and configure it.
There are six...
2015-05-26
863 reads
Microsoft announced this month what features/improvements will be in the next version of SQL Server, SQL Server 2016. You can...
2015-05-26
502 reads
Microsoft announced this month what features/improvements will be in the next version of SQL Server, SQL Server 2016. You can...
2015-05-26
1,366 reads
During data load or transformation processes, capturing a distinct row number for incoming data can be beneficial for the ETL...
2015-05-26
3,325 reads
Hi friends, today we will learn how to get information about database mail profile using stored procedure sysmail_help_profile_sp. Sysmail_help_profile_sp stored...
2015-05-26
340 reads
Your servers are either provisioned or racked, your sys admin has taken care of installing the Failover Clustering feature and...
2015-05-25
504 reads
I wrote recently on how to alter a column in SQL Server from NULL to NOT NULL in a simple...
2015-05-25
676 reads
According to Wikipedia:
Crowdsourcing is the process of obtaining needed services, ideas, or content by soliciting contributions from a large group...
2015-05-25
334 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