CREATE TABLE [dbo].[patient_address_link] (
    [pt_address_key]   INT              IDENTITY (1, 1) NOT NULL,
    [address_key]      INT              NOT NULL,
    [address_type_key] INT              NOT NULL,
    [pt_key]           INT              NOT NULL,
    [pt_address_from]  DATETIME         NOT NULL,
    [pt_address_to]    DATETIME         NULL,
    [modified_dt]      DATETIME         NULL,
    [modified_by_key]  UNIQUEIDENTIFIER NULL,
    CONSTRAINT [patient_address_link_PK] PRIMARY KEY CLUSTERED ([pt_address_key] ASC),
    CONSTRAINT [address_main_patient_address_address_key_FK] FOREIGN KEY ([address_key]) REFERENCES [dbo].[address_main] ([address_key]),
    CONSTRAINT [patient_patient_address_FK1] FOREIGN KEY ([pt_key]) REFERENCES [dbo].[patient] ([pt_key])
);

