Does a clustered index sort the rows within a page
This is just something I was curious about. I ran my tests and got an answer and now I thought...
2014-12-15
1,374 reads
This is just something I was curious about. I ran my tests and got an answer and now I thought...
2014-12-15
1,374 reads
I saw someone ask a few weeks ago if it was faster to drop and re-create an index or do...
2014-12-11
3,439 reads
Almost four months ago I posted my goals for the next year in my two year anniversary post. I pretty...
2014-12-09
761 reads
INSERT INTO SELECT and SELECT INTO may be very similar commands but they have some important differences. Every now and...
2014-12-03
17,096 reads
The other day I was answering a question about clustered indexes and it lead indirectly to a twitter conversation on...
2014-12-08 (first published: 2014-12-01)
7,000 reads
Kenneth Fisher:
I really enjoyed writing this post last year and honestly still enjoy reading it myself. And since tomorrow is...
2014-11-26
1,056 reads
Every now and again you see articles and posts about putting sp_ at the beginning of a stored procedure. So...
2014-11-24
1,099 reads
You see dozens of blog posts and articles about how the order of a result set is not guaranteed without...
2014-12-01 (first published: 2014-11-19)
9,670 reads
We have been using a CMS (Central Management Server) at my office for the last few years. Even beyond the...
2014-11-24 (first published: 2014-11-17)
7,002 reads
Every now and again you realize that the primary key for a table does not uniquely describe a row. Not...
2014-11-13
1,109 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