CREATE TABLE [dbo].[VendorConnect]
(
[VendorConnectID] [int] NOT NULL IDENTITY(1, 1),
[MoversConnectVendorFID] [int] NOT NULL,
[XmlSystemDataTypeMapFID] [int] NOT NULL,
[IntegratorComments] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Inactive] [bit] NOT NULL CONSTRAINT [DF_VendorConnect_Inactive] DEFAULT ((0)),
[IsAgentConnect] [bit] NOT NULL CONSTRAINT [DF_VendorConnect_IsAgentConnect] DEFAULT ((0)),
[EmailAddresses] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[VendorConnect] ADD CONSTRAINT [CK_VendorConnect_IsAgentConnect] CHECK (([dbo].[CheckIsAgentConnectConstraint]([MoversConnectVendorFID],[IsAgentConnect])=(1)))
GO
ALTER TABLE [dbo].[VendorConnect] ADD CONSTRAINT [PK_VendorConnect] PRIMARY KEY CLUSTERED ([VendorConnectID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[VendorConnect] ADD CONSTRAINT [IX_VendorConnect_MoversConnectVendor] UNIQUE NONCLUSTERED ([MoversConnectVendorFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[VendorConnect] ADD CONSTRAINT [IX_VendorConnect_XmlSystemDataTypeMap] UNIQUE NONCLUSTERED ([XmlSystemDataTypeMapFID], [VendorConnectID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[VendorConnect] ADD CONSTRAINT [FK_VendorConnect_MoversConnectVendor] FOREIGN KEY ([MoversConnectVendorFID]) REFERENCES [dbo].[MoversConnectVendor] ([MoversConnectVendorID])
GO
ALTER TABLE [dbo].[VendorConnect] ADD CONSTRAINT [FK_VendorConnect_XmlSystemDataTypeMap] FOREIGN KEY ([XmlSystemDataTypeMapFID]) REFERENCES [dbo].[XmlSystemDataTypeMap] ([XmlSystemDataTypeMapID])
GO
GRANT SELECT ON [dbo].[VendorConnect] TO [MssExec]
GRANT INSERT ON [dbo].[VendorConnect] TO [MssExec]
GRANT DELETE ON [dbo].[VendorConnect] TO [MssExec]
GRANT UPDATE ON [dbo].[VendorConnect] TO [MssExec]
GO