Change column type on constrained columns
Use this proc if you need to alter a column that is part of a primery key
View ArticleAvoid Untrusted Constraints in SQL Server
Some time ago, I loaded a large set of data into one my tables. To speed up the load, I disabled the FOREIGN KEY and CHECK constraints on the table and then re-enabled them after the load was complete....
View ArticleUsing SET NULL and SET DEFAULT with Foreign Key Constraints
Cascading Updates and Deletes, introduced with SQL Server 2000, were such an important, crucial feature that it is hard to imagine providing referential integrity without them. One of the new features...
View ArticleForeign Key Constraints Revisited
Full/partial schema refreshes across environments are a regular requirement in databases. This article builds on a previous article, providing scripts to disable and re-enable foreign key constraints...
View ArticleChanging Primary key names to standard naming convention across the DB
This script will rename the Primary keys to standard notation - PK_TableName
View ArticleWhy is data integrity important?
Why should I care and why should the database enforce it? This article from Jamin VanderBerg gives some reasons why the database is the place to enforce rules that ensure integrity.
View ArticleCase and Padding FK Relationship Tester
Tests the referential integrity of a db when taking into consideration padding and case sensitivity.
View ArticleForeign Key Indexes and Binding
Understand what FK's do and how they use indexes. Then use my script to see if they're using good indexes.
View ArticleSQL Server Referential Integrity Across Databases Using Triggers
In this tip we cover how you can implement SQL Server cross database referential integrity using triggers.
View Article