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 - Explanation and Understanding NOT NULL Constraint

SQL SERVER – Explanation and Understanding NOT NULL Constraint

October 15, 2007
Pinal Dave
SQL Performance
SQL Constraint and Keys, SQL Joins, SQL NULL, SQL Scripts

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.

Read More
SQL SERVER - T-SQL Script to Add Clustered Primary Key

SQL SERVER – T-SQL Script to Add Clustered Primary Key

October 11, 2007
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts

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.

Read More
A ring of plain brass keys on a doormat, one key with a vermilion painted bow standing out from the rest.

Why You Should Name Default Constraints

October 7, 2007
Pinal Dave
SQL Tips and Tricks
Schema, SQL Coding Standards, SQL Constraint and Keys, SQL Server

Name default constraints so deployments can find them reliably, and replace system-generated names through a reviewed migration.

Read More
SQL SERVER - 2005 - List All The Constraint of Database - Find Primary Key and Foreign Key Constraint in Database

SQL SERVER – 2005 – List All The Constraint of Database – Find Primary Key and Foreign Key Constraint in Database

September 16, 2007
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts, SQL System Table

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.

Read More
SQL SERVER - 2005 - Find Tables With Primary Key Constraint in Database

SQL SERVER – 2005 – Find Tables With Primary Key Constraint in Database

September 4, 2007
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts, SQL System Table

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.

Read More
A large yellow key icon.

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

September 4, 2007
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts, SQL Server, SQL System Table

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.

Read More
A furnished room beside the same room drawn as an empty blueprint, showing shape without contents.

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

August 21, 2007
Pinal Dave
SQL Tips and Tricks
Database, SQL Backup and Restore, SQL Constraint and Keys, SQL Cursor, SQL Download, SQL Function, SQL Index, SQL Scripts, SQL Stored Procedure, SQL Trigger

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.

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

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