2009-06-11 (first published: 2009-05-25)
781 reads
2009-06-11 (first published: 2009-05-25)
781 reads
This script is used to print the alter statement and also partition the table with the respective partition Scheme and Partition Function.
2009-06-10 (first published: 2009-05-22)
2,410 reads
Script to convert to N Columns the rows in a table with PIVOT Operator
2009-06-05 (first published: 2009-05-15)
2,030 reads
Here is a stored procedure that start a job, and then waits until the jobs is finished
2009-06-02 (first published: 2009-05-14)
1,069 reads
Finds the largest dupe-sets of one or more columns of a single table or derived table. Great for finding hoggy parameter combinations for perf-testing queries within stored procedures!
2009-05-29 (first published: 2009-05-05)
947 reads
2009-05-27 (first published: 2009-04-30)
2,622 reads
2009-05-22 (first published: 2009-04-28)
3,847 reads
The function is used to find non-printable ASCII characters in an input string.
2009-05-21 (first published: 2009-04-24)
2,998 reads
Lists the Databases and their Backups status in a neatly formatted HTML Email
2009-05-19 (first published: 2009-04-23)
3,007 reads
2009-05-14 (first published: 2009-04-08)
2,012 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