Windowing without a partition by or an order by
If you’ve never worked with windowing functions they look something like this:
SELECT name, max(create_date) OVER
-- No this isn't meant to...
2018-02-21
1,488 reads
If you’ve never worked with windowing functions they look something like this:
SELECT name, max(create_date) OVER
-- No this isn't meant to...
2018-02-21
1,488 reads
When applying a new SQL Server cumulative update, hot fix, or upgrade SQL Server doesn’t always apply all the fixes...
2018-02-21
1,283 reads
In this video tutorial David talks you through the benefits of Azure SQL Elastic pools. Elastic pools allow you to...
2018-02-21
743 reads
Partitioning tables is a great tool to increase the manageability of your data. Being able to move large amounts of...
2018-02-21
3,884 reads
Tomorrow I'll be giving two workshops at the super-slick-brandedActivate Conference 2018 in Baton Rouge at the Louisiana Technology Park, a...
2018-02-21
296 reads
I upgraded SSMS to 17.5 recently and found an interesting addition. This version has incorporated the ability to classify data....
2018-02-20
800 reads
Killing a SPID shouldn’t be complicated. Execute the command KILL [SPID] and that should kill the session. But there are situations...
2018-03-06 (first published: 2018-02-20)
6,347 reads
Today I want to show you a trick that could make your queries run faster.
It won’t always work, but when...
2018-02-20
216 reads
Today I want to show you a trick that could make your queries run faster.
It won't always work, but when it does everyone will be impressed with your performance...
2018-02-20
20 reads
In my introduction to Extended Events blog, I mentioned that the xEvent is my favorite toy for performance troubleshooting. This blog may...
2018-03-05 (first published: 2018-02-20)
11,199 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