How to create a Primary Key, Foreign Key and Default constraint in SQL Server 2008, at column level, at table level, or after the table already exists.
SQL SERVER – Find Primary Key Using SQL Server Management Studio
Need to drop a primary key but do not know the constraint name? Imran Mohammed shows how to find primary key details using SQL Server Management Studio.
SQL SERVER – Create Default Constraint Over Table Column
A small script I keep handy for Jr. Developers: create a default constraint on a table column with ALTER TABLE, and what happens to rows that already have values.
SQL SERVER – 2005 – Find Tables With Foreign Key Constraint in Database – Part 2
Joffery improved my script to find tables with foreign key constraint in a database, adding the ON UPDATE and ON DELETE rules and a little ordering.
SQL SERVER – How to Rename Database Objects to Comply With Naming Conventions
Christopher Miller shares a T-SQL script that renames default constraints to match his team’s naming conventions, cleaning up names that slipped through.
Drawing a Diagram of an Existing Database
A diagram of an existing database starts with real foreign keys, uses SSMS to reveal relationships, and records the important paths a picture misses.






