DROP INDEX and CREATE INDEX vs ALTER INDEX REBUILD
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,440 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,440 reads
Almost four months ago I posted my goals for the next year in my two year anniversary post. I pretty...
2014-12-09
762 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,001 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,105 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,671 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,057 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,100 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,003 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,111 reads
What have I learned recently? Well as it happens I learned something rather interesting recently and was actually trying to...
2014-11-11
1,671 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 Risk Vs Reward, The never...
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...
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