﻿CREATE TABLE [dbo].[Tra_Ev2Stati] (
    [idxStato]     INT NOT NULL,
    [idxEvento]    INT NOT NULL,
    [nextIdxStato] INT NOT NULL,
    CONSTRAINT [PK_Tra_Ev2Stati] PRIMARY KEY CLUSTERED ([idxStato] ASC, [idxEvento] ASC),
    CONSTRAINT [FK_Tra_Ev2Stati_AnagEventi] FOREIGN KEY ([idxEvento]) REFERENCES [dbo].[AnagEventi] ([idxEvento]) ON UPDATE CASCADE,
    CONSTRAINT [FK_Tra_Ev2Stati_AnagStati] FOREIGN KEY ([idxStato]) REFERENCES [dbo].[AnagStati] ([idxStato]) ON UPDATE CASCADE
);

