[dbo].[AdvanceUserAccount]
CREATE TABLE [dbo].[AdvanceUserAccount]
(
[AdvanceUserAccountID] [int] NOT NULL IDENTITY(1, 1),
[SysuserFID] [int] NOT NULL,
[AccountNumber] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[AccountID] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[AdvanceBankingServiceProviderTypeFID] [int] NULL,
[CardNumber] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[DirectDeposit] [bit] NOT NULL CONSTRAINT [DF_AdvanceUserAccount_DirectDeposit] DEFAULT ((0)),
[ChargeAdvanceFee] [bit] NOT NULL CONSTRAINT [DF_AdvanceUserAccount_ChargeAdvanceFee] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AdvanceUserAccount] ADD CONSTRAINT [PK_AdvanceUserAccount] PRIMARY KEY CLUSTERED ([AdvanceUserAccountID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_AdvanceUserAccount_SysuserFID_AdvanceBankingServiceProviderTypeFID] ON [dbo].[AdvanceUserAccount] ([SysuserFID], [AdvanceBankingServiceProviderTypeFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AdvanceUserAccount] ADD CONSTRAINT [FK_AdvanceUserAccount_AdvanceBankingServiceProviderType] FOREIGN KEY ([AdvanceBankingServiceProviderTypeFID]) REFERENCES [dbo].[AdvanceBankingServiceProviderType] ([AdvanceBankingServiceProviderTypeID])
GO
ALTER TABLE [dbo].[AdvanceUserAccount] ADD CONSTRAINT [FK_AdvanceUserAccount_Sysuser] FOREIGN KEY ([SysuserFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
GRANT SELECT ON [dbo].[AdvanceUserAccount] TO [MssExec]
GRANT INSERT ON [dbo].[AdvanceUserAccount] TO [MssExec]
GRANT DELETE ON [dbo].[AdvanceUserAccount] TO [MssExec]
GRANT UPDATE ON [dbo].[AdvanceUserAccount] TO [MssExec]
GO