Tables [dbo].[StatementDetail]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)61138
Created4:57:09 PM Thursday, September 7, 2006
Last Modified1:50:16 PM Wednesday, April 10, 2024
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentityDefault
Cluster Primary Key PK_StatementDetail: SDPriKeySDPriKeyint4
No
1 - 1
Foreign Keys FK_StatementDetail_StatementHeader: [dbo].[StatementHeader].SHPriKeyIndexes IX_StatementDetail_SHPriKey: SHPriKeySHPriKeyint4
No
Foreign Keys FK_StatementDetail_SplitStatement: [dbo].[SplitStatement].SSPriKeyIndexes IX_StatementDetail_SSPriKey: SSPriKeySSPriKeyint4
Yes
OrderControlvarchar(30)30
Yes
Descriptionvarchar(128)128
Yes
Indexes IX_StatementDetail_Amount: AmountAmountmoney8
Yes
(0)
Splitvarchar(1)1
Yes
Foreign Keys FK_StatementDetail_AccountingNote: [dbo].[AccountingNote].ANPriKeyIndexes IX_StatementDetail_ANPriKey: ANPriKeyANPriKeyint4
Yes
Foreign Keys FK_StatementDetail_BRANCH: [dbo].[Branch].BranchPriKeyIndexes IX_StatementDetail_BranchPriKey: BranchPriKeyBranchPriKeyint4
No
CRNumbervarchar(12)12
Yes
DateTimeCreateddatetime8
Yes
Foreign Keys FK_StatementDetail_Sysuser: [dbo].[Sysuser].CreatedByIndexes IX_StatementDetail_CreatedBy: CreatedByCreatedByint4
Yes
VoidedDatedatetime8
Yes
Foreign Keys FK_StatementDetail_Sysuser1: [dbo].[Sysuser].VoidedByIndexes IX_StatementDetail_VoidedBy: VoidedByVoidedByint4
Yes
Foreign Keys FK_StatementDetail_PaymentType: [dbo].[PaymentType].PTPriKeyPTPriKeyint4
Yes
CheckConfvarchar(100)100
Yes
Foreign Keys FK_StatementDetail_AccountingNote2: [dbo].[AccountingNote].CRNoteIndexes IX_StatementDetail_CRNote: CRNoteCRNoteint4
Yes
Foreign Keys FK_StatementDetail_Orders: [dbo].[Orders].OrdPriKeyIndexes IX_StatementDetail_OrdPriKey: OrdPriKeyOrdPriKeyint4
Yes
Indexes IX_StatementDetail_Status: StatusStatusvarchar(10)10
Yes
Foreign Keys FK_StatementDetail_AccountingNote1: [dbo].[AccountingNote].VoidedNoteIndexes IX_StatementDetail_VoidedNote: VoidedNoteVoidedNoteint4
Yes
UnappliedCashsmallint2
Yes
UnappliedAmountmoney8
Yes
(0)
Foreign Keys FK_StatementDetail_PaymentCode: [dbo].[PaymentCode].PaymentCodePriKeyIndexes IX_StatementDetail_PaymentCodePriKey: PaymentCodePriKeyPaymentCodePriKeyint4
Yes
Balancemoney8
Yes
(0)
ApplyAmountmoney8
Yes
(0)
AmountRemainingmoney8
Yes
(0)
ContestChargesmallint2
Yes
(0)
VanLineRefundsmallint2
Yes
(0)
CustomerNumbervarchar(15)15
Yes
Foreign Keys FK_StatementDetail_Division: [dbo].[Division].DivisionFIDIndexes IX_StatementDetail_DivisionFID: DivisionFIDDivisionFIDint4
Yes
SortByvarchar(128)128
Yes
PMImportDetailFIDint4
Yes
Foreign Keys FK_StatementDetail_UnappliedBranch: [dbo].[Branch].UnappliedBranchFIDUnappliedBranchFIDint4
Yes
Foreign Keys FK_StatementDetail_UnappliedDivision: [dbo].[Division].UnappliedDivisionFIDUnappliedDivisionFIDint4
Yes
CRPrintedbit1
No
((0))
IsApplyGridBuiltbit1
No
((0))
Indexes Indexes
NameColumnsUniqueFill Factor
Cluster Primary Key PK_StatementDetail: SDPriKeyPK_StatementDetailSDPriKey
Yes
80
IX_StatementDetail_AmountAmount80
IX_StatementDetail_ANPriKeyANPriKey
IX_StatementDetail_BranchPriKeyBranchPriKey
IX_StatementDetail_CreatedByCreatedBy
IX_StatementDetail_CRNoteCRNote
IX_StatementDetail_DivisionFIDDivisionFID80
IX_StatementDetail_OrdPriKeyOrdPriKey80
IX_StatementDetail_PaymentCodePriKeyPaymentCodePriKey80
IX_StatementDetail_SHPriKeySHPriKey80
IX_StatementDetail_SSPriKeySSPriKey80
IX_StatementDetail_StatusStatus80
IX_StatementDetail_VoidedByVoidedBy
IX_StatementDetail_VoidedNoteVoidedNote
Foreign Keys Foreign Keys
NameColumns
FK_StatementDetail_AccountingNoteANPriKey->[dbo].[AccountingNote].[ANPriKey]
FK_StatementDetail_BRANCHBranchPriKey->[dbo].[Branch].[BranchPriKey]
FK_StatementDetail_SysuserCreatedBy->[dbo].[Sysuser].[SysUserID]
FK_StatementDetail_AccountingNote2CRNote->[dbo].[AccountingNote].[ANPriKey]
FK_StatementDetail_DivisionDivisionFID->[dbo].[Division].[DivisionID]
FK_StatementDetail_OrdersOrdPriKey->[dbo].[Orders].[PriKey]
FK_StatementDetail_PaymentCodePaymentCodePriKey->[dbo].[PaymentCode].[PaymentCodePriKey]
FK_StatementDetail_PaymentTypePTPriKey->[dbo].[PaymentType].[PTPriKey]
FK_StatementDetail_StatementHeaderSHPriKey->[dbo].[StatementHeader].[SHPriKey]
FK_StatementDetail_SplitStatementSSPriKey->[dbo].[SplitStatement].[SSPriKey]
FK_StatementDetail_UnappliedBranchUnappliedBranchFID->[dbo].[Branch].[BranchPriKey]
FK_StatementDetail_UnappliedDivisionUnappliedDivisionFID->[dbo].[Division].[DivisionID]
FK_StatementDetail_Sysuser1VoidedBy->[dbo].[Sysuser].[SysUserID]
FK_StatementDetail_AccountingNote1VoidedNote->[dbo].[AccountingNote].[ANPriKey]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[StatementDetail]
(
[SDPriKey] [int] NOT NULL IDENTITY(1, 1),
[SHPriKey] [int] NOT NULL,
[SSPriKey] [int] NULL,
[OrderControl] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Description] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Amount] [money] NULL CONSTRAINT [DF_StatementDetail_Amount] DEFAULT (0),
[Split] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ANPriKey] [int] NULL,
[BranchPriKey] [int] NOT NULL,
[CRNumber] [varchar] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[DateTimeCreated] [datetime] NULL,
[CreatedBy] [int] NULL,
[VoidedDate] [datetime] NULL,
[VoidedBy] [int] NULL,
[PTPriKey] [int] NULL,
[CheckConf] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CRNote] [int] NULL,
[OrdPriKey] [int] NULL,
[Status] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[VoidedNote] [int] NULL,
[UnappliedCash] [smallint] NULL,
[UnappliedAmount] [money] NULL CONSTRAINT [DF_StatementDetail_UnappliedAmount] DEFAULT (0),
[PaymentCodePriKey] [int] NULL,
[Balance] [money] NULL CONSTRAINT [DF_StatementDetail_Balance] DEFAULT (0),
[ApplyAmount] [money] NULL CONSTRAINT [DF_StatementDetail_ApplyAmount] DEFAULT (0),
[AmountRemaining] [money] NULL CONSTRAINT [DF_StatementDetail_AmountRemaining] DEFAULT (0),
[ContestCharge] [smallint] NULL CONSTRAINT [DF_StatementDetail_ContestCharge] DEFAULT (0),
[VanLineRefund] [smallint] NULL CONSTRAINT [DF_StatementDetail_VanLineRefund] DEFAULT (0),
[CustomerNumber] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[DivisionFID] [int] NULL,
[SortBy] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PMImportDetailFID] [int] NULL,
[UnappliedBranchFID] [int] NULL,
[UnappliedDivisionFID] [int] NULL,
[CRPrinted] [bit] NOT NULL CONSTRAINT [DF_StatementDetail_CRPrinted] DEFAULT ((0)),
[IsApplyGridBuilt] [bit] NOT NULL CONSTRAINT [DF_StatementDetail_IsApplyGridBuilt] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StatementDetail] ADD CONSTRAINT [PK_StatementDetail] PRIMARY KEY CLUSTERED  ([SDPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_StatementDetail_Amount] ON [dbo].[StatementDetail] ([Amount]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_StatementDetail_ANPriKey] ON [dbo].[StatementDetail] ([ANPriKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_StatementDetail_BranchPriKey] ON [dbo].[StatementDetail] ([BranchPriKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_StatementDetail_CreatedBy] ON [dbo].[StatementDetail] ([CreatedBy]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_StatementDetail_CRNote] ON [dbo].[StatementDetail] ([CRNote]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_StatementDetail_DivisionFID] ON [dbo].[StatementDetail] ([DivisionFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_StatementDetail_OrdPriKey] ON [dbo].[StatementDetail] ([OrdPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_StatementDetail_PaymentCodePriKey] ON [dbo].[StatementDetail] ([PaymentCodePriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_StatementDetail_SHPriKey] ON [dbo].[StatementDetail] ([SHPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_StatementDetail_SSPriKey] ON [dbo].[StatementDetail] ([SSPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_StatementDetail_Status] ON [dbo].[StatementDetail] ([Status]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_StatementDetail_VoidedBy] ON [dbo].[StatementDetail] ([VoidedBy]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_StatementDetail_VoidedNote] ON [dbo].[StatementDetail] ([VoidedNote]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StatementDetail] ADD CONSTRAINT [FK_StatementDetail_AccountingNote] FOREIGN KEY ([ANPriKey]) REFERENCES [dbo].[AccountingNote] ([ANPriKey])
GO
ALTER TABLE [dbo].[StatementDetail] ADD CONSTRAINT [FK_StatementDetail_BRANCH] FOREIGN KEY ([BranchPriKey]) REFERENCES [dbo].[Branch] ([BranchPriKey])
GO
ALTER TABLE [dbo].[StatementDetail] ADD CONSTRAINT [FK_StatementDetail_Sysuser] FOREIGN KEY ([CreatedBy]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[StatementDetail] ADD CONSTRAINT [FK_StatementDetail_AccountingNote2] FOREIGN KEY ([CRNote]) REFERENCES [dbo].[AccountingNote] ([ANPriKey])
GO
ALTER TABLE [dbo].[StatementDetail] ADD CONSTRAINT [FK_StatementDetail_Division] FOREIGN KEY ([DivisionFID]) REFERENCES [dbo].[Division] ([DivisionID])
GO
ALTER TABLE [dbo].[StatementDetail] ADD CONSTRAINT [FK_StatementDetail_Orders] FOREIGN KEY ([OrdPriKey]) REFERENCES [dbo].[Orders] ([PriKey])
GO
ALTER TABLE [dbo].[StatementDetail] ADD CONSTRAINT [FK_StatementDetail_PaymentCode] FOREIGN KEY ([PaymentCodePriKey]) REFERENCES [dbo].[PaymentCode] ([PaymentCodePriKey])
GO
ALTER TABLE [dbo].[StatementDetail] ADD CONSTRAINT [FK_StatementDetail_PaymentType] FOREIGN KEY ([PTPriKey]) REFERENCES [dbo].[PaymentType] ([PTPriKey])
GO
ALTER TABLE [dbo].[StatementDetail] ADD CONSTRAINT [FK_StatementDetail_StatementHeader] FOREIGN KEY ([SHPriKey]) REFERENCES [dbo].[StatementHeader] ([SHPriKey])
GO
ALTER TABLE [dbo].[StatementDetail] ADD CONSTRAINT [FK_StatementDetail_SplitStatement] FOREIGN KEY ([SSPriKey]) REFERENCES [dbo].[SplitStatement] ([SSPriKey])
GO
ALTER TABLE [dbo].[StatementDetail] ADD CONSTRAINT [FK_StatementDetail_UnappliedBranch] FOREIGN KEY ([UnappliedBranchFID]) REFERENCES [dbo].[Branch] ([BranchPriKey])
GO
ALTER TABLE [dbo].[StatementDetail] ADD CONSTRAINT [FK_StatementDetail_UnappliedDivision] FOREIGN KEY ([UnappliedDivisionFID]) REFERENCES [dbo].[Division] ([DivisionID])
GO
ALTER TABLE [dbo].[StatementDetail] ADD CONSTRAINT [FK_StatementDetail_Sysuser1] FOREIGN KEY ([VoidedBy]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[StatementDetail] ADD CONSTRAINT [FK_StatementDetail_AccountingNote1] FOREIGN KEY ([VoidedNote]) REFERENCES [dbo].[AccountingNote] ([ANPriKey])
GO
GRANT SELECT ON  [dbo].[StatementDetail] TO [MssExec]
GRANT INSERT ON  [dbo].[StatementDetail] TO [MssExec]
GRANT DELETE ON  [dbo].[StatementDetail] TO [MssExec]
GRANT UPDATE ON  [dbo].[StatementDetail] TO [MssExec]
GO
Uses
Used By