SELECT GetDate() – 30 AS [This actually works??];
I just ran across this in a piece of code (that I didn’t write):
… WHERE Thing >GETDATE()- 30
Aaaand it works....
2011-12-19
1,235 reads
I just ran across this in a piece of code (that I didn’t write):
… WHERE Thing >GETDATE()- 30
Aaaand it works....
2011-12-19
1,235 reads
I say it all the time because it’s worth repeating, feedback is a gift. Good, bad or indifferent (well, not...
2011-12-19
1,735 reads
As the name indicates, CONCAT() will concatenate two or more strings. This is one of the two string functions introduced in...
2011-12-22 (first published: 2011-12-19)
4,008 reads
While some people may consider this topic off limits the fact remains that more and more companies are adopting Apple...
2011-12-19
713 reads
This post is about a contracting in UK. Some of terms mentioned here will not mean a great deal to...
2011-12-19
1,211 reads
Here’s a great post from Karla Landrum about her trip (with husband Rodney) to Brazil for the milestone making #100....
2011-12-19
734 reads
Using Dynamic Values in XMLA
XMLA
A question was raised on Twitter today via the #sqlhelp hash tag about passing parameter values...
2011-12-18
1,942 reads
In the spirit of Robert Davis's (blog | @SQLSoldier) blog post: Undocumented Gotchas of Transactional Replication, I decided to contribute an...
2011-12-18
1,358 reads
Undocumented Gotchas of Transactional Replication
Gotcha - Norelco commercial (1977)
This discussion started on Twitter via the #sqlhelp hash tag. The question that...
2011-12-17
1,402 reads
Today, I’m so excited to announce that we had the first meeting of our Users Group – Albanian SQL Server Users...
2011-12-17
927 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