Check Syntax on a Database
This script finds the first error on all Sprocs, Functions, Triggers and Views in a database. Works in SQL Server 2005 and 2008
2009-04-21 (first published: 2009-03-26)
911 reads
This script finds the first error on all Sprocs, Functions, Triggers and Views in a database. Works in SQL Server 2005 and 2008
2009-04-21 (first published: 2009-03-26)
911 reads
2009-04-17 (first published: 2008-10-15)
1,134 reads
Sixth in a series of scripts demonstrating a quantitative comparison between the text of two stored procedures
2009-04-15 (first published: 2009-02-26)
1,427 reads
2009-04-14 (first published: 2009-03-05)
2,095 reads
2009-04-10 (first published: 2009-03-13)
2,179 reads
2009-04-09 (first published: 2009-03-16)
1,418 reads
SQL Server 2000 does not log the procedures modified using ALTER statement. Here's the script to find out the same.
2009-04-07 (first published: 2009-03-02)
1,318 reads
Fifth in a series of scripts demonstrating a quantitative comparison between the text of two stored procedures
2009-04-03 (first published: 2009-02-23)
1,437 reads
A stored procedure that will return the roles assigned to a user. Can be called from software to validate a user set up with Windows Authentication.
2009-03-25 (first published: 2009-02-19)
1,189 reads
This script will walk the hierarchical chain of users and roles to find users with permissions on an object.
2009-03-24 (first published: 2009-02-18)
1,640 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