This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
SQL SERVER - 2008 - Creating Primary Key, Foreign Key and Default Constraint

SQL SERVER – 2008 – Creating Primary Key, Foreign Key and Default Constraint

September 8, 2008
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts

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.

Read More
SQL SERVER - Find Primary Key Using SQL Server Management Studio

SQL SERVER – Find Primary Key Using SQL Server Management Studio

September 6, 2008
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Index, SQL Scripts, SQL System Table

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.

Read More
SQL SERVER - Create Check Constraint on Column

SQL SERVER – Create Check Constraint on Column

June 22, 2008
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Error Messages, SQL Scripts

A junior developer wrote a trigger to block invalid data. A Check Constraint is simpler. My example limits PostalCode length in AdventureWorks and tests it.

Read More
Create default constraint over table column.

SQL SERVER – Create Default Constraint Over Table Column

May 31, 2008
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts, SQL Server

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.

Read More
SQL SERVER - 2005 - Find Tables With Foreign Key Constraint in Database - Part 2

SQL SERVER – 2005 – Find Tables With Foreign Key Constraint in Database – Part 2

May 8, 2008
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts, SQL System Table

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.

Read More
SQL SERVER - How to Rename Database Objects to Comply With Naming Conventions

SQL SERVER – How to Rename Database Objects to Comply With Naming Conventions

May 2, 2008
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts, SQL Stored Procedure

Christopher Miller shares a T-SQL script that renames default constraints to match his team’s naming conventions, cleaning up names that slipped through.

Read More
A garden trellis with vines tied on with twine, and one vine leaning against it without any tie

Drawing a Diagram of an Existing Database

April 24, 2008
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Documentation, SQL Server, SQL Server Management Studio

A diagram of an existing database starts with real foreign keys, uses SSMS to reveal relationships, and records the important paths a picture misses.

Read More
Previous 1 … 11 12 13 14 15 16 17 18 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com