Dealing with a long string
Every now and again you have to put a really long string (more than 8000 characters). Dynamic SQL is the...
2014-06-25
2,644 reads
Every now and again you have to put a really long string (more than 8000 characters). Dynamic SQL is the...
2014-06-25
2,644 reads
I mentor, teach, and consult about SQL Server. It’s an incredible tool –it is an extremely flexible, adaptable, and complex data environment. SQL Server is capable of bringing tremendous...
2014-06-25
13 reads
I mentor, teach, and consult about SQL Server. It’s an incredible tool –it is an extremely flexible, adaptable, and complex data environment. SQL Server is capable of bringing tremendous...
2014-06-25
12 reads
I mentor, teach, and consult about SQL Server. It’s an incredible tool –it is an extremely flexible, adaptable, and complex...
2014-06-25
472 reads
An auto-growth event is the process by which the SQL Server engine expands the size of a database file when...
2014-06-25
1,109 reads
There may be an easier way, but this was a quick way to find ALL the checked out files in...
2014-06-24
1,469 reads
Retrieve data about size and space used for all the files in the current database with this script.
Some tips on...
2014-06-24
782 reads
No Files For You is another Question Of The Day. I ended up making this one just a little more...
2014-06-24
481 reads
It’s always an honour to be able to speak at an event, but events can be expensive to attend and...
2014-06-24
692 reads
ISSUE : FIX for Data loss in clustered index occurs when you run online build index in SQL Server 2012
Microsoft release...
2014-06-24
898 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