CREATE TABLE [dbo].[WebSHInvoiceQueue]
(
[InvoiceQueueID] [int] NOT NULL IDENTITY(1, 1),
[TypeID] [tinyint] NOT NULL,
[DocumentID] [int] NOT NULL,
[CustomerID] [int] NOT NULL,
[Reference] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_WebSHInvoiceQueue_Reference] DEFAULT (''),
[Address] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[RequestDate] [datetime] NOT NULL CONSTRAINT [DF_WebSHInvoiceQueue_RequestDate] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[WebSHInvoiceQueue] ADD CONSTRAINT [PK_WebSHInvoiceQueue] PRIMARY KEY CLUSTERED ([InvoiceQueueID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[WebSHInvoiceQueue] ADD CONSTRAINT [FK_WebSHInvoiceQueue_CustomerID_ARCustomers] FOREIGN KEY ([CustomerID]) REFERENCES [dbo].[ARCustomers] ([CustomerID])
GO
ALTER TABLE [dbo].[WebSHInvoiceQueue] ADD CONSTRAINT [FK_WebSHInvoiceQueue_TypeID_SHDocumentQueueTypes] FOREIGN KEY ([TypeID]) REFERENCES [dbo].[SHDocumentQueueTypes] ([DocumentQueueTypeID])
GO