CREATE TABLE [dbo].[InvoiceLock]
(
[OrderFid] [int] NOT NULL,
[CreatedBySysUserFid] [int] NOT NULL,
[CreatedOn] [datetime] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InvoiceLock] ADD CONSTRAINT [PK_InvoiceLock] PRIMARY KEY CLUSTERED ([OrderFid]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InvoiceLock] ADD CONSTRAINT [FK_InvoiceLock_SysUser] FOREIGN KEY ([CreatedBySysUserFid]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
GRANT SELECT ON [dbo].[InvoiceLock] TO [MssExec]
GRANT INSERT ON [dbo].[InvoiceLock] TO [MssExec]
GRANT DELETE ON [dbo].[InvoiceLock] TO [MssExec]
GRANT UPDATE ON [dbo].[InvoiceLock] TO [MssExec]
GO