Tables [dbo].[InvoicedHeader]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)62420
Created10:12:50 PM Thursday, December 28, 2006
Last Modified9:11:50 AM Thursday, May 23, 2024
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentityDefaultDescription
Cluster Primary Key PK_InvoicedHeader: IHPriKeyIHPriKeyint4
No
1 - 1
Foreign Keys FK_InvoicedHeader_AccountingNote: [dbo].[AccountingNote].ANPriKeyIndexes IX_InvoicedHeader_ANPriKey: ANPriKeyANPriKeyint4
Yes
Foreign Keys FK_InvoicedHeader_Orders: [dbo].[Orders].OrdPriKeyIndexes IX_InvoicedHeader_OrdPriKey: OrdPriKeyOrdPriKeyint4
No
OrderNumbervarchar(23)23
No
Indexes IX_InvoicedHeader_InvoiceNumber: InvoiceNumberInvoiceNumbervarchar(30)30
No
PrePaymentAmountmoney8
Yes
InvoiceTotalmoney8
No
InvoiceDatedatetime8
No
Foreign Keys FK_InvoicedHeader_Sysuser: [dbo].[Sysuser].CreatedByFIDIndexes IX_InvoicedHeader_CreatedByFID: CreatedByFIDCreatedByFIDint4
No
CreatedDatedatetime8
No
InvoiceTypevarchar(12)12
No
AlternateBillToFIDint4
Yes
CustomerNumbervarchar(15)15
Yes
CustomerNamevarchar(65)65
Yes
BillingContactvarchar(61)61
Yes
BillingAddressvarchar(256)256
Yes
BillingCity[dbo].[AddressCity]26
Yes
BillingState[dbo].[AddressState]2
Yes
BillingPostalCode[dbo].[AddressPostalCode]10
Yes
MoveFromAddressvarchar(768)768
Yes
MoveFromCity[dbo].[AddressCity]26
Yes
MoveFromState[dbo].[AddressState]2
Yes
MoveToAddressvarchar(768)768
Yes
MoveToCity[dbo].[AddressCity]26
Yes
MoveToState[dbo].[AddressState]2
Yes
Foreign Keys FK_HeaderInvoicedHeader_VanlineAddress: [dbo].[VanlineAddress].HeaderVanlineAddressFIDHeaderVanlineAddressFIDint4
Yes
Foreign Keys FK_HeaderInvoicedHeader_BranchAddress: [dbo].[BranchAddress].HeaderBranchAddressFIDHeaderBranchAddressFIDint4
Yes
HeaderTitlevarchar(255)255
Yes
HeaderAddress[dbo].[Address]256
Yes
HeaderCity[dbo].[AddressCity]26
Yes
HeaderState[dbo].[AddressState]2
Yes
HeaderPostalCode[dbo].[AddressPostalCode]10
Yes
HeaderPhone[dbo].[PhoneCombined]30
Yes
HeaderExtension[dbo].[PhoneExtension]10
Yes
HeaderEmailvarchar(120)120
Yes
Foreign Keys FK_RemittanceInvoicedHeader_VanlineAddress: [dbo].[VanlineAddress].RemittanceVanlineAddressFIDRemittanceVanlineAddressFIDint4
Yes
Foreign Keys FK_RemittanceInvoicedHeader_BranchAddress: [dbo].[BranchAddress].RemittanceBranchAddressFIDRemittanceBranchAddressFIDint4
Yes
RemittanceTitlevarchar(255)255
Yes
RemittanceAddress[dbo].[Address]256
Yes
RemittanceCity[dbo].[AddressCity]26
Yes
RemittanceState[dbo].[AddressState]2
Yes
RemittancePostalCode[dbo].[AddressPostalCode]10
Yes
RemittancePhone[dbo].[PhoneCombined]30
Yes
RemittanceExtension[dbo].[PhoneExtension]10
Yes
RemittanceEmailvarchar(120)120
Yes
ShipperFirstNamevarchar(16)16
Yes
ShipperLastNamevarchar(26)26
No
SalesPersonFirstNamevarchar(16)16
Yes
SalesPersonLastNamevarchar(26)26
Yes
ChargeAmountdecimal(19,2)9
No
((0))
ChargeAmountTypevarchar(128)128
Yes
MinimumChargemoney8
No
((0))
Conditionstextmax
Yes
DOTvarchar(50)50
Yes
PONumbervarchar(30)30
Yes
Weightint4
Yes
Tariffvarchar(30)30
Yes
Milesint4
Yes
Foreign Keys FK_InvoicedHeader_InvoiceStatus: [dbo].[InvoiceStatus].InvoiceStatusFIDInvoiceStatusFIDint4
No
Foreign Keys FK_InvoicedHeader_Claim: [dbo].[Claim].ClaimFIDClaimFIDint4
Yes
BillingAddress2varchar(256)256
Yes
BillingAddress3varchar(256)256
Yes
BillingCountryNamevarchar(61)61
Yes
MoveFromCountryCodeStandardFIDint4
Yes
MoveToCountryCodeStandardFIDint4
Yes
Foreign Keys FK_InvoicedHeader_InvoiceTermsOverrideOption: [dbo].[InvoiceTermsOverrideOption].InvoiceTermsOverrideOptionFIDInvoiceTermsOverrideOptionFIDint4
No
((1))
DueDatedatetime8
Yes
OriginalCustomerNumbervarchar(15)15
Yes
This field is used internally to identify the initial customer selected by the user for this invoice.
ReportNamevarchar(425)425
Yes
This field is used internally to locate the report used to generate the actual invoice.
Foreign Keys FK_InvoicedHeader_CustomerInvoiceReport: [dbo].[CustomerInvoiceReport].CustomerInvoiceReportFIDCustomerInvoiceReportFIDint4
Yes
MoveFromPostalCode[dbo].[AddressPostalCode]10
Yes
MoveToPostalCode[dbo].[AddressPostalCode]10
Yes
SalesTaxTotalmoney8
Yes
SalesTaxCommittedbit1
Yes
ServiceCalculatedSalesTaxbit1
Yes
TaxExemptionCodevarchar(25)25
Yes
GeneratingIDuniqueidentifier16
Yes
TaxServiceIDvarchar(30)30
Yes
Indexes Indexes
NameColumnsUniqueFill Factor
Cluster Primary Key PK_InvoicedHeader: IHPriKeyPK_InvoicedHeaderIHPriKey
Yes
80
IX_InvoicedHeader_ANPriKeyANPriKey
IX_InvoicedHeader_CreatedByFIDCreatedByFID
IX_InvoicedHeader_InvoiceNumberInvoiceNumber
IX_InvoicedHeader_OrdPriKeyOrdPriKey
Foreign Keys Foreign Keys
NameColumns
FK_InvoicedHeader_AccountingNoteANPriKey->[dbo].[AccountingNote].[ANPriKey]
FK_InvoicedHeader_ClaimClaimFID->[dbo].[Claim].[ClaimID]
FK_InvoicedHeader_SysuserCreatedByFID->[dbo].[Sysuser].[SysUserID]
FK_InvoicedHeader_CustomerInvoiceReportCustomerInvoiceReportFID->[dbo].[CustomerInvoiceReport].[CustomerInvoiceReportID]
FK_HeaderInvoicedHeader_BranchAddressHeaderBranchAddressFID->[dbo].[BranchAddress].[BranchAddressID]
FK_HeaderInvoicedHeader_VanlineAddressHeaderVanlineAddressFID->[dbo].[VanlineAddress].[VanlineAddressID]
FK_InvoicedHeader_InvoiceStatusInvoiceStatusFID->[dbo].[InvoiceStatus].[InvoiceStatusID]
FK_InvoicedHeader_InvoiceTermsOverrideOptionInvoiceTermsOverrideOptionFID->[dbo].[InvoiceTermsOverrideOption].[InvoiceTermsOverrideOptionID]
FK_InvoicedHeader_OrdersOrdPriKey->[dbo].[Orders].[PriKey]
FK_RemittanceInvoicedHeader_BranchAddressRemittanceBranchAddressFID->[dbo].[BranchAddress].[BranchAddressID]
FK_RemittanceInvoicedHeader_VanlineAddressRemittanceVanlineAddressFID->[dbo].[VanlineAddress].[VanlineAddressID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[InvoicedHeader]
(
[IHPriKey] [int] NOT NULL IDENTITY(1, 1),
[ANPriKey] [int] NULL,
[OrdPriKey] [int] NOT NULL,
[OrderNumber] [varchar] (23) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[InvoiceNumber] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[PrePaymentAmount] [money] NULL,
[InvoiceTotal] [money] NOT NULL,
[InvoiceDate] [datetime] NOT NULL,
[CreatedByFID] [int] NOT NULL,
[CreatedDate] [datetime] NOT NULL,
[InvoiceType] [varchar] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[AlternateBillToFID] [int] NULL,
[CustomerNumber] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CustomerName] [varchar] (65) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[BillingContact] [varchar] (61) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[BillingAddress] [varchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[BillingCity] [dbo].[AddressCity] NULL,
[BillingState] [dbo].[AddressState] NULL,
[BillingPostalCode] [dbo].[AddressPostalCode] NULL,
[MoveFromAddress] [varchar] (768) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[MoveFromCity] [dbo].[AddressCity] NULL,
[MoveFromState] [dbo].[AddressState] NULL,
[MoveToAddress] [varchar] (768) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[MoveToCity] [dbo].[AddressCity] NULL,
[MoveToState] [dbo].[AddressState] NULL,
[HeaderVanlineAddressFID] [int] NULL,
[HeaderBranchAddressFID] [int] NULL,
[HeaderTitle] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[HeaderAddress] [dbo].[Address] NULL,
[HeaderCity] [dbo].[AddressCity] NULL,
[HeaderState] [dbo].[AddressState] NULL,
[HeaderPostalCode] [dbo].[AddressPostalCode] NULL,
[HeaderPhone] [dbo].[PhoneCombined] NULL,
[HeaderExtension] [dbo].[PhoneExtension] NULL,
[HeaderEmail] [varchar] (120) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[RemittanceVanlineAddressFID] [int] NULL,
[RemittanceBranchAddressFID] [int] NULL,
[RemittanceTitle] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[RemittanceAddress] [dbo].[Address] NULL,
[RemittanceCity] [dbo].[AddressCity] NULL,
[RemittanceState] [dbo].[AddressState] NULL,
[RemittancePostalCode] [dbo].[AddressPostalCode] NULL,
[RemittancePhone] [dbo].[PhoneCombined] NULL,
[RemittanceExtension] [dbo].[PhoneExtension] NULL,
[RemittanceEmail] [varchar] (120) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ShipperFirstName] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ShipperLastName] [varchar] (26) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[SalesPersonFirstName] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SalesPersonLastName] [varchar] (26) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ChargeAmount] [decimal] (19, 2) NOT NULL CONSTRAINT [DF_InvoicedHeader_ChargeAmount] DEFAULT ((0)),
[ChargeAmountType] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[MinimumCharge] [money] NOT NULL CONSTRAINT [DF_InvoicedHeader_MinimumCharge] DEFAULT ((0)),
[Conditions] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[DOT] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PONumber] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Weight] [int] NULL,
[Tariff] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Miles] [int] NULL,
[InvoiceStatusFID] [int] NOT NULL,
[ClaimFID] [int] NULL,
[BillingAddress2] [varchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[BillingAddress3] [varchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[BillingCountryName] [varchar] (61) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[MoveFromCountryCodeStandardFID] [int] NULL,
[MoveToCountryCodeStandardFID] [int] NULL,
[InvoiceTermsOverrideOptionFID] [int] NOT NULL CONSTRAINT [DF_InvoicedHeader_InvoiceTermsOverrideOptionFID] DEFAULT ((1)),
[DueDate] [datetime] NULL,
[OriginalCustomerNumber] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ReportName] [varchar] (425) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CustomerInvoiceReportFID] [int] NULL,
[MoveFromPostalCode] [dbo].[AddressPostalCode] NULL,
[MoveToPostalCode] [dbo].[AddressPostalCode] NULL,
[SalesTaxTotal] [money] NULL,
[SalesTaxCommitted] [bit] NULL,
[ServiceCalculatedSalesTax] [bit] NULL,
[TaxExemptionCode] [varchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[GeneratingID] [uniqueidentifier] NULL,
[TaxServiceID] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[InvoicedHeader] ADD CONSTRAINT [PK_InvoicedHeader] PRIMARY KEY CLUSTERED  ([IHPriKey]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_InvoicedHeader_ANPriKey] ON [dbo].[InvoicedHeader] ([ANPriKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_InvoicedHeader_CreatedByFID] ON [dbo].[InvoicedHeader] ([CreatedByFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_InvoicedHeader_InvoiceNumber] ON [dbo].[InvoicedHeader] ([InvoiceNumber]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_InvoicedHeader_OrdPriKey] ON [dbo].[InvoicedHeader] ([OrdPriKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InvoicedHeader] ADD CONSTRAINT [FK_InvoicedHeader_AccountingNote] FOREIGN KEY ([ANPriKey]) REFERENCES [dbo].[AccountingNote] ([ANPriKey])
GO
ALTER TABLE [dbo].[InvoicedHeader] ADD CONSTRAINT [FK_InvoicedHeader_Claim] FOREIGN KEY ([ClaimFID]) REFERENCES [dbo].[Claim] ([ClaimID])
GO
ALTER TABLE [dbo].[InvoicedHeader] ADD CONSTRAINT [FK_InvoicedHeader_Sysuser] FOREIGN KEY ([CreatedByFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[InvoicedHeader] ADD CONSTRAINT [FK_InvoicedHeader_CustomerInvoiceReport] FOREIGN KEY ([CustomerInvoiceReportFID]) REFERENCES [dbo].[CustomerInvoiceReport] ([CustomerInvoiceReportID])
GO
ALTER TABLE [dbo].[InvoicedHeader] ADD CONSTRAINT [FK_HeaderInvoicedHeader_BranchAddress] FOREIGN KEY ([HeaderBranchAddressFID]) REFERENCES [dbo].[BranchAddress] ([BranchAddressID])
GO
ALTER TABLE [dbo].[InvoicedHeader] ADD CONSTRAINT [FK_HeaderInvoicedHeader_VanlineAddress] FOREIGN KEY ([HeaderVanlineAddressFID]) REFERENCES [dbo].[VanlineAddress] ([VanlineAddressID])
GO
ALTER TABLE [dbo].[InvoicedHeader] ADD CONSTRAINT [FK_InvoicedHeader_InvoiceStatus] FOREIGN KEY ([InvoiceStatusFID]) REFERENCES [dbo].[InvoiceStatus] ([InvoiceStatusID])
GO
ALTER TABLE [dbo].[InvoicedHeader] ADD CONSTRAINT [FK_InvoicedHeader_InvoiceTermsOverrideOption] FOREIGN KEY ([InvoiceTermsOverrideOptionFID]) REFERENCES [dbo].[InvoiceTermsOverrideOption] ([InvoiceTermsOverrideOptionID])
GO
ALTER TABLE [dbo].[InvoicedHeader] ADD CONSTRAINT [FK_InvoicedHeader_Orders] FOREIGN KEY ([OrdPriKey]) REFERENCES [dbo].[Orders] ([PriKey])
GO
ALTER TABLE [dbo].[InvoicedHeader] ADD CONSTRAINT [FK_RemittanceInvoicedHeader_BranchAddress] FOREIGN KEY ([RemittanceBranchAddressFID]) REFERENCES [dbo].[BranchAddress] ([BranchAddressID])
GO
ALTER TABLE [dbo].[InvoicedHeader] ADD CONSTRAINT [FK_RemittanceInvoicedHeader_VanlineAddress] FOREIGN KEY ([RemittanceVanlineAddressFID]) REFERENCES [dbo].[VanlineAddress] ([VanlineAddressID])
GO
GRANT SELECT ON  [dbo].[InvoicedHeader] TO [MssExec]
GRANT INSERT ON  [dbo].[InvoicedHeader] TO [MssExec]
GRANT DELETE ON  [dbo].[InvoicedHeader] TO [MssExec]
GRANT UPDATE ON  [dbo].[InvoicedHeader] TO [MssExec]
GO
EXEC sp_addextendedproperty N'MS_Description', N'This field is used internally to identify the initial customer selected by the user for this invoice.', 'SCHEMA', N'dbo', 'TABLE', N'InvoicedHeader', 'COLUMN', N'OriginalCustomerNumber'
GO
EXEC sp_addextendedproperty N'MS_Description', N'This field is used internally to locate the report used to generate the actual invoice.', 'SCHEMA', N'dbo', 'TABLE', N'InvoicedHeader', 'COLUMN', N'ReportName'
GO
Uses
Used By