Madhaiyan Seenivasan’s stored procedure lets you generate foreign key scripts for a whole database, handy when you drop all foreign keys and add them back.
SQL SERVER – Add Column With Default Column Constraint to Table
Add a NOT NULL column with a named default Column Constraint in one ALTER TABLE statement. I always name constraints instead of letting SQL Server pick one.
SQL SERVER – Sharpen Your Basic SQL Server Skills – Learn the distinctions between unique constraint and primary key constraint and the easiest way to get random rows from a table
My March 2007 SQL Server Magazine article explains the distinctions between unique constraint and primary key constraint, and an easy way to get random rows.
Check Constraints That Enforce Business Rules
Check constraints keep row rules inside SQL Server, but NULL behavior and trusted status determine how much protection they provide.
SQL SERVER – TempDB Restrictions – Temp Database Restrictions
What are the TempDB restrictions? A candidate in my interview could not answer. Here is the list, from adding filegroups to backup, restore and more.
SQL SERVER – Three T-SQL Script to Create Primary Keys on Table
Three T-SQL scripts to create primary keys: two while creating the table and one with ALTER TABLE later, where the column must first be NOT NULL.






