PowerShell script repository - SQL Server
A simple get-help output
PowerShell is a .Net based command line tool designed for automation.
It is recommended to script repetitive task...
2018-03-21
318 reads
A simple get-help output
PowerShell is a .Net based command line tool designed for automation.
It is recommended to script repetitive task...
2018-03-21
318 reads
I had recently installed the SQL Toolbelt from Redgate at a client site on a laptop they’d supplied me.
(Fantastic product...
2018-03-21
384 reads
It is fun working with SQL/Application developer where you exchange a lot of technical thoughts to find the root of...
2018-03-21
7,329 reads
Installing R packages in SQL Server 2017 is a breeze with the stored procedure sp_execute_external_script. But so far, it is limited...
2018-03-20
467 reads
Given that Microsoft now considers Linux a ‘first-class citizen’, SQL Server 2017 offers native support for Linux. It is engineered...
2018-03-20
364 reads
One misconception some people have about SQL injection is that it can only happen when concatenating a user input parameter...
2018-03-27 (first published: 2018-03-20)
5,072 reads
Watch this week's video on YouTube
One misconception some people have about SQL injection is that it can only happen when concatenating a user input parameter directly into your dynamically...
2018-03-20
15 reads
Watch this week's video on YouTube
One misconception some people have about SQL injection is that it can only happen when concatenating a user input parameter directly into your dynamically...
2018-03-20
24 reads
An Introduction to Enterprise Architecture
In this series I’m going to be looking at enterprise architecture. Over the last few years...
2018-03-20
407 reads
SQL Server Management Objects (SMO) are the .NET classes underpinning Management Studio and all good PowerShell that interfaces with SQL...
2018-03-20
84 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