What a NOT NULL constraint does and two ways to add one: when the table is created, or after the table is created. My example covers both.
SQL SERVER – T-SQL Script to Add Clustered Primary Key
A Jr. DBA asked me three times in one day how to create a clustered primary key, so I gave him this ALTER TABLE example. He never asked again.
Why You Should Name Default Constraints
Name default constraints so deployments can find them reliably, and replace system-generated names through a reviewed migration.
SQL SERVER – 2005 – List All The Constraint of Database – Find Primary Key and Foreign Key Constraint in Database
A simple script from my archive lists all constraints from sys.objects, so you can check each foreign key and primary key constraint in database tables.
SQL SERVER – 2005 – Find Tables With Primary Key Constraint in Database
A script to find tables with primary key constraint in a SQL Server 2005 database, listing the index name, table name and column name from sys.indexes.
SQL SERVER – 2005 – Find Tables With Foreign Key Constraint in Database
Keys are critical to any database. This script finds every table with a foreign key constraint in SQL Server 2005, with its column and the referenced table.
SQL SERVER – 2005 – Create Script to Copy Database Schema and All The Objects – Stored Procedure, Functions, Triggers, Tables, Views, Constraints and All Other Database Objects
A step by step tutorial to create a T-SQL script that can copy database schema and all objects, like stored procedures, functions, triggers, tables and views.






