Partitioning on a nullable column
tl;dr; If you are SWITCHing data into a table and the partitioning column is nullable you will need to add...
2017-05-17 (first published: 2017-05-03)
2,130 reads
tl;dr; If you are SWITCHing data into a table and the partitioning column is nullable you will need to add...
2017-05-17 (first published: 2017-05-03)
2,130 reads
Quite a while ago I created a couple of little security scripts to help me out with permissions research. Over...
2017-05-12 (first published: 2017-05-01)
2,311 reads
I had this question come up at work the other day and while I knew it was true I wasn’t...
2017-05-08 (first published: 2017-04-26)
3,868 reads
When you right click on a tab you’ll see a number of different options. You can set up new horizontal...
2017-04-24
393 reads
We all know indexes are good and I’m hoping everyone knows you can have too many indexes. That means we...
2017-04-21 (first published: 2017-04-19)
2,961 reads
tl;dr; While at one point the cost of a query was an estimated time to run in seconds, today it’s...
2017-04-17
517 reads
You know, sometimes you get a silly idea in your head and you just HAVE to try it out. The...
2017-04-13
406 reads
Koen Verbeeck (b/t) is hosting T-SQL Tuesday this month and our topic is The times they are a-changing. In other...
2017-04-11
488 reads
Wellll .. technically there is no native way to do it. I even went through my notes on identity columns. No...
2017-04-05
498 reads
Extended Properties
Sometimes you find out the strangest things about SQL Server. I’ve written about extended properties before but had no...
2017-04-03
528 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