Tables [dbo].[StatementPayable]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)4242
Created2:15:29 PM Monday, February 3, 2014
Last Modified3:41:22 PM Tuesday, November 18, 2014
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentityDefault
Cluster Primary Key PK_StatementPayable: StatementPayableIDIndexes IX_StatementPayable_StatementDetail: StatementDetailFID\StatementPayableIDStatementPayableIDint4
No
1 - 1
Foreign Keys FK_StatementPayable_StatementDetail: [dbo].[StatementDetail].StatementDetailFIDIndexes IX_StatementPayable_StatementDetailDist: StatementDetailFID\StatementDetailDistFID\VendorIDIndexes IX_StatementPayable_StatementDetail: StatementDetailFID\StatementPayableIDStatementDetailFIDint4
No
Foreign Keys FK_StatementPayable_StatementDetailDist: [dbo].[StatementDetailDist].StatementDetailDistFIDIndexes IX_StatementPayable_StatementDetailDist: StatementDetailFID\StatementDetailDistFID\VendorIDStatementDetailDistFIDint4
Yes
Descriptionvarchar(128)128
Yes
Foreign Keys FK_StatementPayable_Branch: [dbo].[Branch].BranchFIDBranchFIDint4
No
Foreign Keys FK_StatementPayable_Division: [dbo].[Division].DivisionFIDDivisionFIDint4
Yes
Indexes IX_StatementPayable_StatementDetailDist: StatementDetailFID\StatementDetailDistFID\VendorIDVendorIDvarchar(15)15
No
Amountmoney8
No
((0))
1099Flagbit1
No
((0))
DocumentNumbervarchar(23)23
Yes
ApplyAmountmoney8
No
((0))
GPFlagbit1
No
((0))
Indexes Indexes
NameColumnsUnique
Cluster Primary Key PK_StatementPayable: StatementPayableIDPK_StatementPayableStatementPayableID
Yes
IX_StatementPayable_StatementDetailStatementDetailFID, StatementPayableID
IX_StatementPayable_StatementDetailDistStatementDetailFID, StatementDetailDistFID, VendorID
Foreign Keys Foreign Keys
NameColumns
FK_StatementPayable_BranchBranchFID->[dbo].[Branch].[BranchPriKey]
FK_StatementPayable_DivisionDivisionFID->[dbo].[Division].[DivisionID]
FK_StatementPayable_StatementDetailDistStatementDetailDistFID->[dbo].[StatementDetailDist].[SDDPriKey]
FK_StatementPayable_StatementDetailStatementDetailFID->[dbo].[StatementDetail].[SDPriKey]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[StatementPayable]
(
[StatementPayableID] [int] NOT NULL IDENTITY(1, 1),
[StatementDetailFID] [int] NOT NULL,
[StatementDetailDistFID] [int] NULL,
[Description] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[BranchFID] [int] NOT NULL,
[DivisionFID] [int] NULL,
[VendorID] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Amount] [money] NOT NULL CONSTRAINT [DF_StatementPayable_Amount] DEFAULT ((0)),
[1099Flag] [bit] NOT NULL CONSTRAINT [DF_StatementPayable_1099Flag] DEFAULT ((0)),
[DocumentNumber] [varchar] (23) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ApplyAmount] [money] NOT NULL CONSTRAINT [DF_StatementPayable_ApplyAmount] DEFAULT ((0)),
[GPFlag] [bit] NOT NULL CONSTRAINT [DF_StatementPayable_GPFlag] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StatementPayable] ADD CONSTRAINT [PK_StatementPayable] PRIMARY KEY CLUSTERED  ([StatementPayableID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_StatementPayable_StatementDetailDist] ON [dbo].[StatementPayable] ([StatementDetailFID], [StatementDetailDistFID], [VendorID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_StatementPayable_StatementDetail] ON [dbo].[StatementPayable] ([StatementDetailFID], [StatementPayableID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StatementPayable] ADD CONSTRAINT [FK_StatementPayable_Branch] FOREIGN KEY ([BranchFID]) REFERENCES [dbo].[Branch] ([BranchPriKey])
GO
ALTER TABLE [dbo].[StatementPayable] ADD CONSTRAINT [FK_StatementPayable_Division] FOREIGN KEY ([DivisionFID]) REFERENCES [dbo].[Division] ([DivisionID])
GO
ALTER TABLE [dbo].[StatementPayable] ADD CONSTRAINT [FK_StatementPayable_StatementDetailDist] FOREIGN KEY ([StatementDetailDistFID]) REFERENCES [dbo].[StatementDetailDist] ([SDDPriKey])
GO
ALTER TABLE [dbo].[StatementPayable] ADD CONSTRAINT [FK_StatementPayable_StatementDetail] FOREIGN KEY ([StatementDetailFID]) REFERENCES [dbo].[StatementDetail] ([SDPriKey])
GO
GRANT SELECT ON  [dbo].[StatementPayable] TO [MssExec]
GRANT INSERT ON  [dbo].[StatementPayable] TO [MssExec]
GRANT DELETE ON  [dbo].[StatementPayable] TO [MssExec]
GRANT UPDATE ON  [dbo].[StatementPayable] TO [MssExec]
GO
Uses