2014-09-29 (first published: 2010-02-04)
9,508 reads
2014-09-29 (first published: 2010-02-04)
9,508 reads
A fast and accurate way to calculate the distance in miles between two points, based on the latitudes and longitudes.
2014-09-26 (first published: 2009-01-31)
9,254 reads
2014-09-25 (first published: 2010-12-23)
26,178 reads
2014-09-23 (first published: 2010-02-17)
11,513 reads
This script will allow you get all the users and roles with permission on objects on all databases.
2014-09-18 (first published: 2009-03-05)
35,812 reads
Populate a calendar table with user set interval start and end datetime values.
2014-09-16 (first published: 2014-02-21)
2,120 reads
Populate a calendar table with user set interval start and end datetime values.
2014-09-15 (first published: 2014-02-21)
2,019 reads
2014-09-12 (first published: 2011-12-22)
3,348 reads
Transpose N rows of a table (v2.0 allows user to specify the table's schema)
2014-09-10 (first published: 2010-01-29)
2,071 reads
Create crosstab queries as easily as MS Access with a lot more power.
2014-09-09 (first published: 2009-04-02)
4,514 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