The T-SQL ROW_NUMBER() Function
If you learn one new T-SQL (i.e., Microsoft SQL Server) concept today it should be ROW_NUMBER(). Introduced in SQL 2005,...
2014-03-22
2,978 reads
If you learn one new T-SQL (i.e., Microsoft SQL Server) concept today it should be ROW_NUMBER(). Introduced in SQL 2005,...
2014-03-22
2,978 reads
I’ve been actively seeking out opportunities to do more stuff with Powershell of late.
I had wanted to script out only...
2014-03-21
4,086 reads
I recently presented a free webinar for Pragmatic Works Free Training on the T’s about Getting Started With Analysis Services....
2014-03-21
1,449 reads
Photo credit – JStove
Old posts are like unicorns. You might see them just once, but it’d sure be nice to have...
2014-03-21
386 reads
Hopefully you had a chance to answer the Alas Poor Snapshot, I Knew Him Well question of the day than...
2014-03-21
453 reads
There is one thing we all have in common, and a lot of us probably don’t even realize it, baselines!
While...
2014-03-21
713 reads
I almost forgot to tell you about the Database Administration Virtual Chapter meeting next week, March 26th, 2014. I’ll be...
2014-03-21
642 reads
It’s Friday, time to look back at the most popular RealSQLGuy posts of the week. Because it’s Friday and you’re...
2014-03-21
349 reads
There is one thing we all have in common, and a lot of us probably don’t even realize it, baselines!
...
2014-03-27 (first published: 2014-03-21)
2,534 reads
Question: How many Oracle DBAs can you fit in Madison Square Garden?
Answer: None, their egos won’t fit through the door.
No,...
2014-03-21
646 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