Tables [dbo].[CustomerInvoiceReportEDIItem]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)10
Created11:16:06 AM Wednesday, January 9, 2013
Last Modified10:27:18 AM Monday, March 30, 2015
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Cluster Primary Key PK_CustomerInvoiceReportEDIItem: CustomerInvoiceReportEDIItemIDIndexes IX_CustomerInvoiceReportEDIItem_Report_EDIItemCode_ItemCode: CustomerInvoiceReportFID\EDIItemCode\ItemCodeFID\PointOfServiceFID\Description\CustomerInvoiceReportEDIItemIDCustomerInvoiceReportEDIItemIDint4
No
1 - 1
Foreign Keys FK_CustomerInvoiceReportEDIItem_CustomerInvoiceReportFID: [dbo].[CustomerInvoiceReport].CustomerInvoiceReportFIDIndexes IX_CustomerInvoiceReportEDIItem_Report_EDIItemCode_ItemCode: CustomerInvoiceReportFID\EDIItemCode\ItemCodeFID\PointOfServiceFID\Description\CustomerInvoiceReportEDIItemIDIndexes IX_CustomerInvoiceReportEDIItem_Report_ItemCode: CustomerInvoiceReportFID\ItemCodeFIDIndexes IX_CustomerInvoiceReportEDIItem_Report_RevenueGroup_ItemCode: CustomerInvoiceReportFID\RevenueGroupFID\ItemCodeFIDCustomerInvoiceReportFIDint4
No
Indexes IX_CustomerInvoiceReportEDIItem_Report_EDIItemCode_ItemCode: CustomerInvoiceReportFID\EDIItemCode\ItemCodeFID\PointOfServiceFID\Description\CustomerInvoiceReportEDIItemIDEDIItemCodevarchar(32)32
No
Indexes IX_CustomerInvoiceReportEDIItem_Report_EDIItemCode_ItemCode: CustomerInvoiceReportFID\EDIItemCode\ItemCodeFID\PointOfServiceFID\Description\CustomerInvoiceReportEDIItemIDDescriptionvarchar(128)128
No
UnitOfMeasure1varchar(4)4
Yes
UnitOfMeasure2varchar(4)4
Yes
Foreign Keys FK_CustomerInvoiceReportEDIItem_RevenueGroupFID: [dbo].[RevGroups].RevenueGroupFIDIndexes IX_CustomerInvoiceReportEDIItem_Report_RevenueGroup_ItemCode: CustomerInvoiceReportFID\RevenueGroupFID\ItemCodeFIDRevenueGroupFIDint4
Yes
Foreign Keys FK_CustomerInvoiceReportEDIItem_ItemCodeFID: [dbo].[ItemCode].ItemCodeFIDIndexes IX_CustomerInvoiceReportEDIItem_Report_EDIItemCode_ItemCode: CustomerInvoiceReportFID\EDIItemCode\ItemCodeFID\PointOfServiceFID\Description\CustomerInvoiceReportEDIItemIDIndexes IX_CustomerInvoiceReportEDIItem_Report_ItemCode: CustomerInvoiceReportFID\ItemCodeFIDIndexes IX_CustomerInvoiceReportEDIItem_Report_RevenueGroup_ItemCode: CustomerInvoiceReportFID\RevenueGroupFID\ItemCodeFIDItemCodeFIDint4
Yes
Foreign Keys FK_CustomerInvoiceReportEDIItem_PointOfServiceFID: [dbo].[PointOfService].PointOfServiceFIDIndexes IX_CustomerInvoiceReportEDIItem_Report_EDIItemCode_ItemCode: CustomerInvoiceReportFID\EDIItemCode\ItemCodeFID\PointOfServiceFID\Description\CustomerInvoiceReportEDIItemIDPointOfServiceFIDint4
Yes
LocationCode1varchar(32)32
Yes
LocationCode2varchar(32)32
Yes
Foreign Keys FK_CustomerInvoiceReportEDIItem_EDIMileageTypeFID: [dbo].[EDIMileageType].EDIMileageTypeFIDEDIMileageTypeFIDint4
Yes
AlternateWeightRequiredbit1
Yes
ItemVerificationRequiredbit1
Yes
Indexes Indexes
NameColumnsUnique
Cluster Primary Key PK_CustomerInvoiceReportEDIItem: CustomerInvoiceReportEDIItemIDPK_CustomerInvoiceReportEDIItemCustomerInvoiceReportEDIItemID
Yes
IX_CustomerInvoiceReportEDIItem_Report_EDIItemCode_ItemCodeCustomerInvoiceReportFID, EDIItemCode, ItemCodeFID, PointOfServiceFID, Description, CustomerInvoiceReportEDIItemID
IX_CustomerInvoiceReportEDIItem_Report_ItemCodeCustomerInvoiceReportFID, ItemCodeFID
IX_CustomerInvoiceReportEDIItem_Report_RevenueGroup_ItemCodeCustomerInvoiceReportFID, RevenueGroupFID, ItemCodeFID
Check Constraints Check Constraints
NameConstraint
CK_CustomerInvoiceReportEDIItem_ItemCode_RevenueGroup(NOT ([ItemCodeFID] IS NOT NULL AND [RevenueGroupFID] IS NOT NULL))
Foreign Keys Foreign Keys
NameColumns
FK_CustomerInvoiceReportEDIItem_CustomerInvoiceReportFIDCustomerInvoiceReportFID->[dbo].[CustomerInvoiceReport].[CustomerInvoiceReportID]
FK_CustomerInvoiceReportEDIItem_EDIMileageTypeFIDEDIMileageTypeFID->[dbo].[EDIMileageType].[EDIMileageTypeID]
FK_CustomerInvoiceReportEDIItem_ItemCodeFIDItemCodeFID->[dbo].[ItemCode].[ICPriKey]
FK_CustomerInvoiceReportEDIItem_PointOfServiceFIDPointOfServiceFID->[dbo].[PointOfService].[PointOfServiceID]
FK_CustomerInvoiceReportEDIItem_RevenueGroupFIDRevenueGroupFID->[dbo].[RevGroups].[RGPriKey]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[CustomerInvoiceReportEDIItem]
(
[CustomerInvoiceReportEDIItemID] [int] NOT NULL IDENTITY(1, 1),
[CustomerInvoiceReportFID] [int] NOT NULL,
[EDIItemCode] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Description] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[UnitOfMeasure1] [varchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[UnitOfMeasure2] [varchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[RevenueGroupFID] [int] NULL,
[ItemCodeFID] [int] NULL,
[PointOfServiceFID] [int] NULL,
[LocationCode1] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LocationCode2] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[EDIMileageTypeFID] [int] NULL,
[AlternateWeightRequired] [bit] NULL,
[ItemVerificationRequired] [bit] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[CustomerInvoiceReportEDIItem] ADD CONSTRAINT [CK_CustomerInvoiceReportEDIItem_ItemCode_RevenueGroup] CHECK ((NOT ([ItemCodeFID] IS NOT NULL AND [RevenueGroupFID] IS NOT NULL)))
GO
ALTER TABLE [dbo].[CustomerInvoiceReportEDIItem] ADD CONSTRAINT [PK_CustomerInvoiceReportEDIItem] PRIMARY KEY CLUSTERED  ([CustomerInvoiceReportEDIItemID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_CustomerInvoiceReportEDIItem_Report_EDIItemCode_ItemCode] ON [dbo].[CustomerInvoiceReportEDIItem] ([CustomerInvoiceReportFID], [EDIItemCode], [ItemCodeFID], [PointOfServiceFID], [Description], [CustomerInvoiceReportEDIItemID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_CustomerInvoiceReportEDIItem_Report_ItemCode] ON [dbo].[CustomerInvoiceReportEDIItem] ([CustomerInvoiceReportFID], [ItemCodeFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_CustomerInvoiceReportEDIItem_Report_RevenueGroup_ItemCode] ON [dbo].[CustomerInvoiceReportEDIItem] ([CustomerInvoiceReportFID], [RevenueGroupFID], [ItemCodeFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[CustomerInvoiceReportEDIItem] ADD CONSTRAINT [FK_CustomerInvoiceReportEDIItem_CustomerInvoiceReportFID] FOREIGN KEY ([CustomerInvoiceReportFID]) REFERENCES [dbo].[CustomerInvoiceReport] ([CustomerInvoiceReportID])
GO
ALTER TABLE [dbo].[CustomerInvoiceReportEDIItem] ADD CONSTRAINT [FK_CustomerInvoiceReportEDIItem_EDIMileageTypeFID] FOREIGN KEY ([EDIMileageTypeFID]) REFERENCES [dbo].[EDIMileageType] ([EDIMileageTypeID])
GO
ALTER TABLE [dbo].[CustomerInvoiceReportEDIItem] ADD CONSTRAINT [FK_CustomerInvoiceReportEDIItem_ItemCodeFID] FOREIGN KEY ([ItemCodeFID]) REFERENCES [dbo].[ItemCode] ([ICPriKey])
GO
ALTER TABLE [dbo].[CustomerInvoiceReportEDIItem] ADD CONSTRAINT [FK_CustomerInvoiceReportEDIItem_PointOfServiceFID] FOREIGN KEY ([PointOfServiceFID]) REFERENCES [dbo].[PointOfService] ([PointOfServiceID])
GO
ALTER TABLE [dbo].[CustomerInvoiceReportEDIItem] ADD CONSTRAINT [FK_CustomerInvoiceReportEDIItem_RevenueGroupFID] FOREIGN KEY ([RevenueGroupFID]) REFERENCES [dbo].[RevGroups] ([RGPriKey])
GO
GRANT SELECT ON  [dbo].[CustomerInvoiceReportEDIItem] TO [MssExec]
GRANT INSERT ON  [dbo].[CustomerInvoiceReportEDIItem] TO [MssExec]
GRANT DELETE ON  [dbo].[CustomerInvoiceReportEDIItem] TO [MssExec]
GRANT UPDATE ON  [dbo].[CustomerInvoiceReportEDIItem] TO [MssExec]
GO
Uses
Used By