CREATE TABLE [dbo].[ATScript] (
    [ScriptModuleName] NVARCHAR (255) NOT NULL,
    [ProcessID]        INT            NULL,
    [EventID]          INT            NULL,
    [ModuleType]       INT            NULL,
    [CODE]             IMAGE          NULL,
    [FRX]              IMAGE          NULL,
    CONSTRAINT [Atscript_FK1] FOREIGN KEY ([ProcessID]) REFERENCES [dbo].[ATProcessDefinition] ([ProcessID]),
    CONSTRAINT [Atscript_FK2] FOREIGN KEY ([EventID]) REFERENCES [dbo].[ATEventDefinition] ([EventID])
);


GO
CREATE NONCLUSTERED INDEX [ATScript_IX_EventId]
    ON [dbo].[ATScript]([EventID] ASC);


GO
CREATE NONCLUSTERED INDEX [ATScript_IX_ProcessId]
    ON [dbo].[ATScript]([ProcessID] ASC);

