You can’t use aggregate/windowing functions with CROSS APPLY
One of my favorite features of CROSS APPLY is the ability to use it instead of a calculated variable. Well...
2014-10-13 (first published: 2014-10-06)
9,198 reads
One of my favorite features of CROSS APPLY is the ability to use it instead of a calculated variable. Well...
2014-10-13 (first published: 2014-10-06)
9,198 reads
I had an article published yesterday on http://www.SQLShack.com.
Intro to Auditing in SQL Server.
It’s worth reading if I do say...
2014-10-01
1,226 reads
One of the options you had when installing your instance was setting some default file locations.
Defaut data file locationDefault log...
2014-10-01 (first published: 2014-09-29)
8,127 reads
For a SQL Server guy it sometimes amazes me how often I’m in and out of batch files and how...
2014-09-24
629 reads
I was recently asked where to go in Configuration Manager to change the settings for xp_cmdshell. It was then that...
2014-09-24 (first published: 2014-09-22)
8,020 reads
For the love of all that’s SQL, triggers are not toys! I’m not even talking about logon triggers or DDL...
2014-09-17
1,444 reads
Sorry for the click bait but I just couldn’t resist, and to be fair I was pretty impressed with this...
2014-09-15
1,192 reads
Trace flags are one of those things that I’ve heard about more and more over the last five or six...
2014-09-18 (first published: 2014-09-11)
7,966 reads
It’s that time again. The second Tuesday of each month we have a blog party called T-SQL Tuesday. The host...
2014-09-12 (first published: 2014-09-09)
6,725 reads
I’m sure most of you have looked at the control options of the SQL services right? Start an instance, stop...
2014-09-04
3,877 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