Listing 1: Code to Create Matching Tables with a Foreign Key Constraint USE tempdb GO DROP TABLE t2 DROP TABLE t1 GO CREATE TABLE t1(col1 int NOT NULL PRIMARY KEY) CREATE TABLE t2(col1 int NOT NULL) INSERT INTO t1 VALUES(1) INSERT INTO t2 VALUES(1) ALTER TABLE t2 WITH CHECK ADD CONSTRAINT fk_t2_t1 FOREIGN KEY(col1) REFERENCES t1(col1)