How to Write a Better T-SQL Code
Here are some basic guidelines that are good to consider when writing T-SQL (Transact SQL). These tips and hints are aimed for the beginner-level T-SQL developers. Always Use a...
2018-11-17
45 reads
Here are some basic guidelines that are good to consider when writing T-SQL (Transact SQL). These tips and hints are aimed for the beginner-level T-SQL developers. Always Use a...
2018-11-17
45 reads
Here are some basic guidelines that are good to consider when writing T-SQL (Transact SQL). These tips and hints are...
2018-11-28 (first published: 2018-11-16)
4,511 reads
Have you ever been in a meeting where the attendees seemed to go down one rabbit trail after another? At...
2018-11-30 (first published: 2018-11-16)
1,836 reads
Be sure to subscript to our RSS feed to keep up with the latest SQL Server news and tips!
http://vitamindba.com/feed/
The post...
2018-11-16
311 reads
“Power BI is just growing and growing and getting better and better at an amazing rate.” Who said that? Watch...
2018-11-16
209 reads
AdvertisementsSQL server error log load to a table
There are cases, we need a SQL server error log load to a table...
2018-11-16
382 reads
At PASS Summit, I presented a session called “Do Your Data Visualizations Need a Makeover?”. In my session I explained...
2018-11-27 (first published: 2018-11-15)
2,743 reads
Another post for me that is simple and hopefully serves as an example for people trying to get blogging as...
2018-11-30 (first published: 2018-11-15)
1,899 reads
Have you ever imagine you can determine the version of SQL Server from a bak or a MDF file? I...
2018-11-26 (first published: 2018-11-15)
18,418 reads
Hopefully, a database being taken offline is a known event and not a surprise. Occasionally there are gremlins, in the form of users with too many permissions, that tend...
2018-11-15
138 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