• Normally when I create tables with foreign keys, I'll specify the foreign key as part of the column definition. Keeps everything in one place.

    eg
    CREATE TABLE Stations (
        StationID INT IDENTITY PRIMARY KEY,
        StarSystemID INT FOREIGN KEY REFERENCES dbo.StarSystems (StarSystemID) NOT NULL,
        OfficialName VARCHAR(50) NOT NULL,
        CommonName VARCHAR(50),
        Planet TINYINT NOT NULL,
        Location VARCHAR(15) NOT NULL
    );

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass