[dbo].[AdvanceBankingServiceProvider]
CREATE TABLE [dbo].[AdvanceBankingServiceProvider]
(
[AdvanceBankingServiceProviderID] [int] NOT NULL IDENTITY(1, 1),
[VendorID] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[GenerateTransactionsFlag] [bit] NOT NULL,
[AdvanceBankingServiceProviderTypeFID] [int] NOT NULL,
[FTPGenerateUploadFileFlag] [bit] NOT NULL CONSTRAINT [DF_AdvanceBankingServiceProvider_FTPGenerateUploadFileFlag] DEFAULT ((0)),
[FTPAutoUploadFlag] [bit] NOT NULL CONSTRAINT [DF_AdvanceBankingServiceProvider_FTPAutoUploadFlag] DEFAULT ((0)),
[FTPUserName] [varchar] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FTPPassword] [varchar] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FTPHost] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FTPPort] [int] NULL CONSTRAINT [DF_AdvanceBankingServiceProvider_FTPPort] DEFAULT ((21))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AdvanceBankingServiceProvider] ADD CONSTRAINT [CK_FTPAutoUploadFlag] CHECK (([FTPAutoUploadFlag]=(1) AND [FTPUserName] IS NOT NULL AND [FTPPassword] IS NOT NULL AND [FTPHost] IS NOT NULL AND [FTPPort] IS NOT NULL OR [FTPAutoUploadFlag]=(0)))
GO
ALTER TABLE [dbo].[AdvanceBankingServiceProvider] ADD CONSTRAINT [CK_VendorIDGenerateTransactionsFlag] CHECK (([GenerateTransactionsFlag]=(1) AND [VendorID] IS NOT NULL OR [GenerateTransactionsFlag]=(0)))
GO
ALTER TABLE [dbo].[AdvanceBankingServiceProvider] ADD CONSTRAINT [PK_AdvanceBankingServiceProvider] PRIMARY KEY CLUSTERED ([AdvanceBankingServiceProviderID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AdvanceBankingServiceProvider] ADD CONSTRAINT [IX_AdvanceBankingServiceProvider_AdvanceBankingServiceProviderTypeFID] UNIQUE NONCLUSTERED ([AdvanceBankingServiceProviderTypeFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AdvanceBankingServiceProvider] ADD CONSTRAINT [FK_AdvanceBankingServiceProvider_Type] FOREIGN KEY ([AdvanceBankingServiceProviderTypeFID]) REFERENCES [dbo].[AdvanceBankingServiceProviderType] ([AdvanceBankingServiceProviderTypeID])
GO
GRANT SELECT ON [dbo].[AdvanceBankingServiceProvider] TO [MssExec]
GRANT INSERT ON [dbo].[AdvanceBankingServiceProvider] TO [MssExec]
GRANT DELETE ON [dbo].[AdvanceBankingServiceProvider] TO [MssExec]
GRANT UPDATE ON [dbo].[AdvanceBankingServiceProvider] TO [MssExec]
GO