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 - A Common Design Problem - Should the Primary Key Always be a Clustered Index

SQL SERVER – A Common Design Problem – Should the Primary Key Always be a Clustered Index

November 23, 2009
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys

Should the Primary Key always be a clustered index? A design discussion about SSN numbers stored as strings and when a separate clustered index makes sense.

Read More
SQL SERVER - Disable CHECK Constraint - Enable CHECK Constraint

SQL SERVER – Disable CHECK Constraint – Enable CHECK Constraint

November 12, 2009
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Index, SQL Scripts

Need to disable CHECK constraint validation for a bulk load? Here is how, and how to enable it again with WITH CHECK CHECK CONSTRAINT, the syntax with CHECK twice.

Read More
Beach towels laid edge to edge on the sand, seen from above, one red towel overlapping its neighbor

Preventing Overlapping Date Ranges in a Table

October 31, 2009
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL DateTime, SQL Server, SQL Transactions, SQL Trigger

Detect overlapping date ranges with joins and window queries, use half-open endpoints, and enforce the rule with a multirow trigger.

Read More
Candidate Key Query.

SQL SERVER – Difference Between Candidate Keys and Primary Key In Simple Words

October 22, 2009
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts

The difference between candidate keys and primary key in simple words: any unique column can be a candidate key, but only one becomes the primary key.

Read More
SQL SERVER - Discussion - Effect of Missing Identity on System - Real World Scenario

SQL SERVER – Discussion – Effect of Missing Identity on System – Real World Scenario

August 11, 2009
Pinal Dave
SQL Puzzle
Database, DBA, SQL Constraint and Keys, SQL Index

Is there any real world reason to list a missing identity in a table? Readers had no new script, but a lively discussion on whether gaps matter.

Read More
Generate primary and foreign keys.

SQL SERVER – Puzzle – Write Script to Generate Primary Key and Foreign Key

July 23, 2009
Pinal Dave
SQL Puzzle
SQL Constraint and Keys, SQL Scripts

A puzzle from a migration project: SSMS cannot script every Primary Key and Foreign Key at once. Can you write a script that generates them all?

Read More
SQL SERVER - Two Methods to Retrieve List of Primary Keys and Foreign Keys of Database

SQL SERVER – Two Methods to Retrieve List of Primary Keys and Foreign Keys of Database

July 17, 2009
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts, SQL Server

There are two different methods to retrieve the list of Primary Keys and Foreign Keys from the database.

Read More
Previous 1 … 8 9 10 11 12 13 14 … 19 Next
  • Books
  • Testimonials
  • Privacy Policy

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