[dbo].[QuoteItemExternal]
CREATE TABLE [dbo].[QuoteItemExternal]
(
[QuoteItemExternalID] [int] NOT NULL IDENTITY(1, 1),
[QuoteHeaderFID] [int] NOT NULL,
[XmlInterfaceFID] [int] NOT NULL,
[QuoteGroupFID] [int] NOT NULL,
[QuoteDetailFID] [int] NULL,
[UniqueId] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[LastSentRowVersion] [varbinary] (8) NULL,
[LastSentItemCodeFID] [int] NULL,
[SentDeleteNotification] [bit] NOT NULL CONSTRAINT [DF_QuoteItemExternal_SentDeleteNotification] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[QuoteItemExternal] ADD CONSTRAINT [PK_QuoteItemExternal] PRIMARY KEY NONCLUSTERED ([QuoteItemExternalID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_QuoteItemExternal_QuoteDetail] ON [dbo].[QuoteItemExternal] ([QuoteDetailFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_QuoteItemExternal_QuoteGroup] ON [dbo].[QuoteItemExternal] ([QuoteGroupFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_QuoteItemExternal_QuoteHeader_XmlInterface_UniqueId] ON [dbo].[QuoteItemExternal] ([QuoteHeaderFID], [XmlInterfaceFID], [UniqueId]) INCLUDE ([QuoteDetailFID], [QuoteGroupFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[QuoteItemExternal] ADD CONSTRAINT [FK_QuoteItemExternal_QuoteHeader] FOREIGN KEY ([QuoteHeaderFID]) REFERENCES [dbo].[QuoteHeader] ([QuoteHeaderID])
GO
ALTER TABLE [dbo].[QuoteItemExternal] ADD CONSTRAINT [FK_QuoteItemExternal_XmlInterface] FOREIGN KEY ([XmlInterfaceFID]) REFERENCES [dbo].[XmlInterface] ([XmlInterfaceID])
GO
GRANT SELECT ON [dbo].[QuoteItemExternal] TO [MssExec]
GRANT INSERT ON [dbo].[QuoteItemExternal] TO [MssExec]
GRANT DELETE ON [dbo].[QuoteItemExternal] TO [MssExec]
GRANT UPDATE ON [dbo].[QuoteItemExternal] TO [MssExec]
GO