CREATE TABLE [dbo].[APVendorCustomProperties]
(
[VendorCustomPropertyID] [int] NOT NULL IDENTITY(1, 1),
[VendorID] [int] NOT NULL,
[ShAttributeID] [int] NOT NULL,
[IDVal] [int] NULL,
[TextVal] [varchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Required] [bit] NOT NULL CONSTRAINT [DF_APVendorCustomProperties_Required] DEFAULT ((0)),
[CreatorID] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CreateDate] [datetime] NOT NULL CONSTRAINT [DF_APVendorCustomProperties_CreateDate] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[APVendorCustomProperties] ADD CONSTRAINT [PK_APVendorCustomProperties] PRIMARY KEY CLUSTERED ([VendorCustomPropertyID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[APVendorCustomProperties] ADD CONSTRAINT [FK_APVendorCustomProperties_ShAttributeID_ShAttributes] FOREIGN KEY ([ShAttributeID]) REFERENCES [dbo].[ShAttributes] ([ShAttributeID])
GO
ALTER TABLE [dbo].[APVendorCustomProperties] ADD CONSTRAINT [FK_APVendorCustomProperties_VendorID_APVendors] FOREIGN KEY ([VendorID]) REFERENCES [dbo].[APVendors] ([VendorID])
GO