New T-SQL Fixed Width "Splitter"
A brand new tally table based, fixed width "splitter" that can be used for much more than just string splitting
2016-06-22 (first published: 2016-05-14)
2,003 reads
A brand new tally table based, fixed width "splitter" that can be used for much more than just string splitting
2016-06-22 (first published: 2016-05-14)
2,003 reads
Script that searches every object in a database for a specific string.
2016-06-20 (first published: 2016-05-02)
1,084 reads
Use below query to find tables that need to be optimized based on number of forwarded records.
2016-06-16 (first published: 2016-05-05)
605 reads
2016-06-14 (first published: 2016-05-02)
1,887 reads
Generates code for INSERTs as well as generating data form tables for INSERT. Will also find and script all dependencies recursively, present all scripts in dependency order, and generate a reverse-dependency order set of conditional DELETE statements.
2016-06-13 (first published: 2015-06-04)
2,169 reads
Removes characters in the a string (@string) that matches a specific pattern (updated 12-3-14)
2016-06-10 (first published: 2014-10-27)
4,725 reads
Log and report on table growth for trending, so you can track exactly which table(s) are your hotspots for growth.
2016-06-09 (first published: 2016-05-05)
1,805 reads
2016-06-08 (first published: 2016-04-28)
922 reads
Procedure to compare two tables , getting table names and rows to display
2016-06-07 (first published: 2016-05-06)
1,071 reads
Replication related script- quick way to determine the publication name, Article and column which are part of the different publications.
2016-06-06 (first published: 2016-05-09)
905 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