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.
Modeling Data Before Writing Tables
Modeling data before tables clarifies entities, relationships, keys, and grain so schema changes do not discover the rules too late.
Building Your Own Sample Data Set
Build a sample data set with realistic keys, skew, NULLs, and repeatable generation when a downloaded sample misses the lesson.
SQL SERVER – A Common Design Problem – Should the Primary Key Always be a Clustered Index
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.
SQL SERVER – Disable CHECK Constraint – Enable CHECK Constraint
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.
Preventing Overlapping Date Ranges in a Table
Detect overlapping date ranges with joins and window queries, use half-open endpoints, and enforce the rule with a multirow trigger.
SQL SERVER – Difference Between Candidate Keys and Primary Key In Simple Words
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.







