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 large and a small copy of the same book on a library shelf, a hand sliding the small one back out.

Case-Insensitive Unique Constraints in a Case-Sensitive Database

September 25, 2023
Pinal Dave
SQL Tips and Tricks
Computed Column, SQL Collation, SQL Constraint and Keys, SQL Index, SQL Server

Enforce case-insensitive unique user names in a case-sensitive database using an indexed computed column with an explicit collation.

Read More
A shepherd's hand checking one darker stray sheep among a cream flock inside a stone-walled pen

Checking Constraints After a Bulk Load With DBCC CHECKCONSTRAINTS

September 19, 2022
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Server, SQL Server DBCC

Run DBCC CHECKCONSTRAINTS after a controlled bulk-load bypass, inspect violations, and restore enabled trusted CHECK and foreign-key rules.

Read More
A white goose standing among lettuces as a hand closes the garden gate that was propped open behind it.

NOCHECK CONSTRAINT: Loading Data and Trusting Foreign Keys Again

October 8, 2021
Pinal Dave
SQL Tips and Tricks
ETL, SQL Constraint and Keys, SQL Scripts, SQL Server

Use NOCHECK CONSTRAINT carefully, distinguish enabled from trusted foreign keys, validate old rows, and restore optimizer assumptions.

Read More
A street bicycle rack with a different bicycle in each slot and several empty slots between them.

A Unique Constraint That Allows Many NULLs

October 7, 2021
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Index, SQL NULL, SQL Server

Allow many NULLs while enforcing unique non-NULL values with a filtered SQL Server index, required SET options, and tested queries.

Read More
A chain link remover replacing a central connector without discarding attached links

Self-Referencing Foreign Keys: Managers, Employees and Deletes

July 19, 2021
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Constraint and Keys, SQL Server

Delete a manager and SQL Server says no, which is good. See how to reassign reports safely and how to catch loops the foreign key allows.

Read More
Two beach towels thrown onto one empty deckchair at once, a cream towel covering the seat and a red one sliding off.

Handling Duplicate Key Errors 2627 and 2601 in a CATCH Block

April 15, 2021
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Error Messages, SQL Server, SQL Transactions

Handle duplicate key errors 2627 and 2601 in TRY CATCH, preserve unexpected errors, and avoid racing existence checks during inserts.

Read More
An engaged fitting clamp remains separate from older pieces awaiting inspection.

SQL SERVER – Find Untrusted Foreign Key

March 3, 2021
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts, SQL Server, SQL Server Security

An Untrusted Foreign key has not validated all existing rows. A customer bulk-load history prompted this inventory.

Read More
1 2 3 4 … 23 Next
  • Books
  • Testimonials
  • Privacy Policy

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