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 - Create Primary Key with Specific Name when Creating Table

SQL SERVER – Create Primary Key with Specific Name when Creating Table

April 22, 2010
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts

How do you create a primary key with specific name while creating the table itself? One CREATE TABLE statement can define and name the constraint.

Read More
A cardboard model house beside an empty plot where string lines and stakes mark out rooms in the grass.

Modeling Data Before Writing Tables

March 6, 2010
Pinal Dave
SQL Tips and Tricks
Database, Normalization, Primary Key, SQL Constraint and Keys

Modeling data before tables clarifies entities, relationships, keys, and grain so schema changes do not discover the rules too late.

Read More
Hands arranging fabric squares into a patchwork quilt pattern

Building Your Own Sample Data Set

January 24, 2010
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Sample Database, SQL Scripts, Testing

Build a sample data set with realistic keys, skew, NULLs, and repeatable generation when a downloaded sample misses the lesson.

Read More
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
Previous 1 … 12 13 14 15 16 17 18 … 23 Next
  • Books
  • Testimonials
  • Privacy Policy

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