Tricks - Copy T SQL Result to Excel
Sometimes, some of the silliest of tricks save so much of time and effort. Very common scenario is to copy a query result to excel. Most take either of...
2017-11-25
13 reads
Sometimes, some of the silliest of tricks save so much of time and effort. Very common scenario is to copy a query result to excel. Most take either of...
2017-11-25
13 reads
SQL Server 2017 and Azure SQL Database are being touted as the self learning, artificial intelligent database. One of the main reasons for the same is due to release...
2017-11-13
142 reads
SQL Server 2017 and Azure SQL Database are being touted as the self learning, artificial intelligent database. One of the main reasons for the same is due to release...
2017-11-13
18 reads
SQL Server 2017 and Azure SQL Database are being touted as the self learning, artificial intelligent database. One of the...
2017-11-12
544 reads
150th Blog Post . So, the post involves video demo 🙂
Previous posts on this series was about using "Geo Replication" to...
2017-10-27
387 reads
150th Blog Post . So, the post involves video demo :)Previous posts on this series was about using "Geo Replication" to configure active secondary. However, it comes with few...
2017-10-27
34 reads
150th Blog Post . So, the post involves video demo :)Previous posts on this series was about using "Geo Replication" to configure active secondary. However, it comes with few...
2017-10-27
11 reads
By default, on a SQL Server Database, statistics are updated automatically when one hits a threshold of changes. If the...
2017-09-19 (first published: 2017-09-06)
2,069 reads
Dear All,
Very happy to share the 8th interview of #DataChannel. Dr. Leila Etaati MVP, MCT from New Zealand discusses...
2017-09-11 (first published: 2017-08-28)
1,633 reads
By default, on a SQL Server Database, statistics are updated automatically when one hits a threshold of changes. If the Auto Update Statistics setting is turned on by default,...
2017-09-06
1,600 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