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 - How to Disable and Enable All Constraint for Table and Database

SQL SERVER – How to Disable and Enable All Constraint for Table and Database

December 2, 2014
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys

Readers often ask how to disable and enable all constraint for table and database. Here are simple ALTER TABLE scripts for both, plus one for a single constraint.

Read More
Hands digging through a huge bin of mixed balls for the red ones, an empty sorted rack standing unused

Foreign Keys Without Indexes: Finding and Fixing Slow Deletes

July 9, 2014
Pinal Dave
SQL Performance
SQL Constraint and Keys, SQL Delete, SQL Index, SQL Performance

Find foreign keys without indexes, inspect parent-delete plans, and choose leading child-table keys that support relationship checks.

Read More
SQL SERVER - Drop All the Foreign Key Constraint in Database - Create All the Foreign Key Constraint in Database

SQL SERVER – Drop All the Foreign Key Constraint in Database – Create All the Foreign Key Constraint in Database

April 11, 2014
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts

Need to drop all the foreign key constraints in a database and create them again? Here is a script by SQL expert Swastik Mishra that does both.

Read More
Displaying table and columns for SQL query.

SQL SERVER – Listing Primary Key of Table with Stored Procedure sp_pkeys

March 2, 2014
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys

Here is how to list the primary key of a table with the stored procedure sp_pkeys, a follow up to my earlier post on sp_fkeys.

Read More
Sp_fkeys output window.

SQL SERVER – Listing Foreign Key Relationships of Table with Stored Procedure sp_fkeys

March 1, 2014
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys

A quick trick to list all the foreign key relationships of a table with the stored procedure sp_fkeys, with a sample script on AdventureWorks2012.

Read More
A figure struggles with a chain.

SQL SERVER – Create Unique Constraint on Table Column on Existing Table

January 11, 2014
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys

Can you create unique constraint on a column of a table that already exists? Yes. Here is the short ALTER TABLE ADD CONSTRAINT script I use.

Read More
A shed shelf of clay pots, several turned upside down among growing plants.

Soft Delete With an IsDeleted Column: Indexes, Views and Keys

September 7, 2013
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Index, SQL Server, SQL View

Design soft delete with an IsDeleted flag, filtered unique keys and indexes, a live-row view, and a measured archive process.

Read More
Previous 1 … 3 4 5 6 7 8 9 … 18 Next
  • Books
  • Testimonials
  • Privacy Policy

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