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
A hand raising a single vermilion pennant on a flagpole above a harbor full of moored boats.

Adding a NOT NULL Column With a Default to a Big Table

May 1, 2013
Pinal Dave
SQL Tips and Tricks
DBA, SQL Column, SQL Constraint and Keys, SQL Server, SQL Table Operation

Add a NOT NULL column with a default safely, distinguish metadata changes from row updates, and plan a staged Standard edition rollout.

Read More
SQL SERVER - Disable All the Foreign Key Constraint in Database - Enable All the Foreign Key Constraint in Database

SQL SERVER – Disable All the Foreign Key Constraint in Database – Enable All the Foreign Key Constraint in Database

April 29, 2013
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys

A tester wanted to load bad data, but foreign keys got in the way. Here is how to disable all the foreign key constraints in a database and enable them again.

Read More
SQL SERVER - Fix: Error: 1505 The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name and the index name

SQL SERVER – Fix: Error: 1505 The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name and the index name

February 5, 2013
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Error Messages

Error 1505 says the CREATE UNIQUE INDEX statement terminated because a duplicate key was found. The word key confuses many developers, so I explain it simply.

Read More
A hand lifts the top glass from a pyramid of stacked glasses, a red napkin at its base.

Walking Foreign Key Chains to Find a Safe Delete Order

November 3, 2012
Pinal Dave
SQL Tips and Tricks
CTE, SQL Constraint and Keys, SQL Delete, SQL Server

Map foreign key chains from a parent table with a recursive catalog query, then list deepest children first and flag cascade rules.

Read More
A hand holding a steel punch over a new silver spoon on an anvil, ready to stamp its maker's mark.

Audit Columns From Day One: CreatedAt, UpdatedAt and Who Changed It

October 17, 2012
Pinal Dave
SQL Tips and Tricks
SQL Audit, SQL Constraint and Keys, SQL DateTime, SQL Server, SQL Trigger

Add audit columns with UTC timestamps and trusted change identities, maintain updates in procedures, and know when history is needed.

Read More
A wooden bee hotel of hollow tubes on a garden wall, each tube sealed separately, one bee landing at its own.

A Multi-Tenant Schema With a TenantId Column: Keys, Indexes and Safety

October 16, 2012
Pinal Dave
SQL Tips and Tricks
Schema, SQL Constraint and Keys, SQL Index, SQL Server, SQL Server Security

Design a multi-tenant schema with composite keys, tenant-first indexes, trusted session context, and row-level security checks.

Read More
Magnifying glass silhouette.

SQL SERVER – Curious Case of Disappearing Rows – ON UPDATE CASCADE and ON DELETE CASCADE – Part 1 of 2

August 16, 2012
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Server

Rows kept vanishing from a product table with no DELETE anywhere in the code. Part 1 of a puzzle that leads to ON UPDATE CASCADE and ON DELETE CASCADE.

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

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