Schema only backup or schema only DB copy
Every now and again you have a database where you don’t necessarily need the data. It can easily be re-loaded...
2017-10-25
1,175 reads
Every now and again you have a database where you don’t necessarily need the data. It can easily be re-loaded...
2017-10-25
1,175 reads
In this age of cost-saving after cost-saving, one way you may be looking at saving money is by combining multiple...
2017-11-01 (first published: 2017-10-23)
2,123 reads
CTEs are cool things. You can essentially create one or more in-line view(s) within your query. One thing that isn’t...
2017-10-18
1,972 reads
Temporal tables are one of those new (2016+) cool features that recently came across my desk. Basically, a temporal table...
2017-10-26 (first published: 2017-10-16)
1,855 reads
I’ve you’ve done much work with the system views (DMVs for example) then you’ve had to translate an object_id into...
2017-10-11
431 reads
We frequently talk about dealing with outgrowing INT identity columns. What we don’t talk about all that often is small...
2017-10-17 (first published: 2017-10-09)
1,851 reads
The BEGIN/END block is a fairly standard thing if you’ve ever done any coding, but it never hurts to do...
2017-10-04
954 reads
I decided that for Halloween this year it would be fun to tell SQL ghost stories. When I tweeted about...
2017-10-03
342 reads
Last month your homework was to set up your own lab. Now it’s time to put a sample database or...
2017-10-02
436 reads
My goal here is to have something fun (and hopefully educational/thinky) (and yes, I did just make up the word...
2017-09-27
462 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