T-SQL Tuesday #57 – SQL Family and Community
Look at that, it is once again that time of the month that has come to be known as TSQL...
2014-08-12
749 reads
Look at that, it is once again that time of the month that has come to be known as TSQL...
2014-08-12
749 reads
Maybe it is just me, but these monthly block parties seem to be coming around quicker and quicker as time...
2014-08-12
309 reads
Common date values you may need to reference that you may not want to write from scratch each time.
Hope...
2014-08-12
1,057 reads
If you want to create sample random samples when dealing with date calculations to test your results, you can easily...
2014-08-12
530 reads
This month’s T-SQL Tuesday topic is SQL Family and is brought to us by Jeffrey Verheul (b/t). It’s an amazing...
2014-08-12
602 reads
It’s T-SQL Tuesday time again. After missing two months with my sabbatical, I’m back.
The topic this month is hosted by...
2014-08-12
711 reads
Following in the footsteps of such greats community leaders as Brent Ozar and Kevin Kline I have the opportunity, nay...
2014-08-12
617 reads
Sum():- This function is used to get the sum of values of the specified numeric column.
Syntax:-
Select Sum (column_name) from tablename
Example:-...
2014-08-12
726 reads
Round():-This function is used to round a numeric field to the number of decimals specified.
Syntax:-
ROUND ( numeric_expression , length [ ,function ]
numeric_expression...
2014-08-12
884 reads
This function returns the distinct values from the left query that are not also found on the right query. For...
2014-08-12
783 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