DROP IF EXISTS
It’s amazing the things that SQL can do these days. It’s also amazing how many of them I’ve managed to ... Continue reading
2020-03-23
307 reads
It’s amazing the things that SQL can do these days. It’s also amazing how many of them I’ve managed to ... Continue reading
2020-03-23
307 reads
A while back a company I worked for had two teams. One was a development team and the other was ... Continue reading
2020-03-19
117 reads
After my post last month about configuring your tools I’ve been on a make my life easier kick and one ... Continue reading
2020-03-13 (first published: 2020-03-04)
2,702 reads
A little while back we tried configuring the instance. Sometimes though, instance settings are a bit heavy handed, so this ... Continue reading
2020-03-05 (first published: 2020-03-02)
471 reads
When I’m working with a tool I like a clean startup. And by that I mean don’t automatically open anything. ... Continue reading
2020-03-03 (first published: 2020-02-24)
172 reads
The other day I saw a weird option for the UPDATE command in a stack overflow answer. Basically it looked ... Continue reading
2020-03-02 (first published: 2020-02-19)
1,936 reads
DBA, a job, a vital job. T-SQL a language that is fun. Select, a query to get some data. From, ... Continue reading
2020-02-26
29 reads
I realized in my last #PowershellBasics post that I was talking about running a file and passing in an optional ... Continue reading
2020-02-25 (first published: 2020-02-17)
567 reads
Happy T-SQL Tuesday! Thanks for hosting this month Jess Pomfret (blog|twitter) and great topic. Life Hacks. There is one thing ... Continue reading
2020-02-18 (first published: 2020-02-11)
650 reads
I dislike the term Politically Correct. Not because the original idea of it is a bad one, but it’s been ... Continue reading
2020-02-13
68 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 Risk Vs Reward, The never...
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...
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