Tables [dbo].[CommStmtDetail]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)61357
Created4:57:07 PM Thursday, September 7, 2006
Last Modified9:12:51 AM Friday, November 8, 2024
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentityDefault
Cluster Primary Key PK_CommStmtDetail: MSIDIndexes IX_CommStmtDetail_DocumentNumber: MSID\DocumentNumber\CommissionTypeMSIDint4
No
1 - 1
Foreign Keys FK_CommStmtDetail_CommStmtVendor: [dbo].[CommStmtVendor].CommStmtVendorIndexes IX_CommStmtDetail_CommStmtVendor: CommStmtVendorCommStmtVendorint4
No
Indexes IX_CommStmtDetail_DocumentNumber: MSID\DocumentNumber\CommissionTypeDocumentNumbervarchar(21)21
No
DocumentDatedatetime8
No
DocumentAmountmoney8
No
Indexes IX_CommStmtDetail_OrderNumber: OrderNumberOrderNumbervarchar(23)23
No
ShipperNamevarchar(50)50
No
InvoiceAmountmoney8
No
((0))
RevenueAmountmoney8
No
((0))
Indexes IX_CommStmtDetail_DocumentNumber: MSID\DocumentNumber\CommissionTypeCommissionTypevarchar(8)8
No
CommissionBasisvarchar(32)32
No
CommissionAmountmoney8
No
CommissionPercfloat8
No
CommissionFactormoney8
No
OrderWeightint4
No
AmountAfterSplitsmoney8
No
ItemDescriptionvarchar(128)128
No
Indexes IX_CommStmtDetail_VoucherNumber: VoucherNumberVoucherNumbervarchar(21)21
No
('')
DocTypeint4
No
(0)
NetAmountmoney8
No
((0))
AllocatedItemDescriptionvarchar(128)128
Yes
Milesint4
Yes
Indexes Indexes
NameColumnsUniqueFill Factor
Cluster Primary Key PK_CommStmtDetail: MSIDPK_CommStmtDetailMSID
Yes
80
IX_CommStmtDetail_CommStmtVendorCommStmtVendor80
IX_CommStmtDetail_DocumentNumberMSID, DocumentNumber, CommissionType
IX_CommStmtDetail_OrderNumberOrderNumber80
IX_CommStmtDetail_VoucherNumberVoucherNumber80
Foreign Keys Foreign Keys
NameDeleteColumns
FK_CommStmtDetail_CommStmtVendorCascadeCommStmtVendor->[dbo].[CommStmtVendor].[MSID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[CommStmtDetail]
(
[MSID] [int] NOT NULL IDENTITY(1, 1),
[CommStmtVendor] [int] NOT NULL,
[DocumentNumber] [varchar] (21) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[DocumentDate] [datetime] NOT NULL,
[DocumentAmount] [money] NOT NULL,
[OrderNumber] [varchar] (23) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ShipperName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[InvoiceAmount] [money] NOT NULL CONSTRAINT [DF_CommStmtDetail_InvoiceAmount] DEFAULT ((0)),
[RevenueAmount] [money] NOT NULL CONSTRAINT [DF_CommStmtDetail_RevenueAmount] DEFAULT ((0)),
[CommissionType] [varchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CommissionBasis] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CommissionAmount] [money] NOT NULL,
[CommissionPerc] [float] NOT NULL,
[CommissionFactor] [money] NOT NULL,
[OrderWeight] [int] NOT NULL,
[AmountAfterSplits] [money] NOT NULL,
[ItemDescription] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[VoucherNumber] [varchar] (21) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_CommStmtDetail_VoucherNumber] DEFAULT (''),
[DocType] [int] NOT NULL CONSTRAINT [DF_CommStmtDetail_DocType] DEFAULT (0),
[NetAmount] [money] NOT NULL CONSTRAINT [DF_CommStmtDetail_NetAmount] DEFAULT ((0)),
[AllocatedItemDescription] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Miles] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[CommStmtDetail] ADD CONSTRAINT [PK_CommStmtDetail] PRIMARY KEY CLUSTERED  ([MSID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_CommStmtDetail_CommStmtVendor] ON [dbo].[CommStmtDetail] ([CommStmtVendor]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_CommStmtDetail_DocumentNumber] ON [dbo].[CommStmtDetail] ([DocumentNumber], [CommissionType]) INCLUDE ([MSID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_CommStmtDetail_OrderNumber] ON [dbo].[CommStmtDetail] ([OrderNumber]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_CommStmtDetail_VoucherNumber] ON [dbo].[CommStmtDetail] ([VoucherNumber]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[CommStmtDetail] ADD CONSTRAINT [FK_CommStmtDetail_CommStmtVendor] FOREIGN KEY ([CommStmtVendor]) REFERENCES [dbo].[CommStmtVendor] ([MSID]) ON DELETE CASCADE
GO
GRANT SELECT ON  [dbo].[CommStmtDetail] TO [MssExec]
GRANT INSERT ON  [dbo].[CommStmtDetail] TO [MssExec]
GRANT DELETE ON  [dbo].[CommStmtDetail] TO [MssExec]
GRANT UPDATE ON  [dbo].[CommStmtDetail] TO [MssExec]
GO
Uses