Changing Foreign key names to standard naming convention across the DB
Rename the Foreign keys to standard notation - FK_childTable_ParentTable
2010-02-24 (first published: 2010-02-09)
1,204 reads
Rename the Foreign keys to standard notation - FK_childTable_ParentTable
2010-02-24 (first published: 2010-02-09)
1,204 reads
Useful if you think a SQL statement, Function, or SPROC is taking too long to compile.
2010-02-23 (first published: 2010-02-04)
986 reads
Scripts used to create the functionality to auto-generate your very own customized serial IDs.
2010-02-22 (first published: 2010-02-04)
1,860 reads
This script will either reoprt or 'fix' lost or orphaned users after restore for all versions of SQL.
2010-02-19 (first published: 2010-02-04)
2,286 reads
2010-02-15 (first published: 2010-01-18)
24,162 reads
This script basically retreives all database users thier database roles for a database.
2010-02-10 (first published: 2010-01-20)
3,513 reads
2010-02-08 (first published: 2010-01-13)
4,177 reads
2010-02-05 (first published: 2010-01-18)
1,103 reads
This code will let you script a Table or Views structure for source control.
2010-02-02 (first published: 2010-01-12)
2,233 reads
This script will allow user to analysis their Subscribed Reports.
2010-02-01 (first published: 2010-01-11)
2,316 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