CREATE TABLE [dbo].[ATQueueEvent] (
    [Queue]   NVARCHAR (32) NOT NULL,
    [EventID] INT           NOT NULL,
    CONSTRAINT [PK_AtQueueEvent] PRIMARY KEY NONCLUSTERED ([Queue] ASC, [EventID] ASC),
    CONSTRAINT [ATQueueEvent_ATEventDefinition] FOREIGN KEY ([EventID]) REFERENCES [dbo].[ATEventDefinition] ([EventID]),
    CONSTRAINT [ATQueueEvent_ATQueue] FOREIGN KEY ([Queue]) REFERENCES [dbo].[ATQueue] ([Queue])
);


GO
CREATE NONCLUSTERED INDEX [ATQueueEvent_IX_EventId]
    ON [dbo].[ATQueueEvent]([EventID] ASC);

