Tables [dbo].[RevenueRatingImportedInvoiceDetail]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)0
Created9:19:45 AM Friday, November 8, 2024
Last Modified9:19:48 AM Friday, November 8, 2024
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Primary Key PK_RevenueRatingImportedInvoiceDetail: RevenueRatingImportedInvoiceDetailIDRevenueRatingImportedInvoiceDetailIDint4
No
1 - 1
Cluster Key IX_RevenueRatingImportedInvoiceDetailFID: RevenueRatingImportedHeaderFIDForeign Keys FK_RevenueRatingImportedInvoiceDetail_RevenueRatingImportedHeader: [dbo].[RevenueRatingImportedHeader].RevenueRatingImportedHeaderFIDRevenueRatingImportedHeaderFIDint4
No
Foreign Keys FK_RevenueRatingImportedInvoiceDetail_Agent: [dbo].[Agent].AgentFIDAgentFIDint4
Yes
Descriptionvarchar(128)128
Yes
GrossAmountdecimal(12,4)9
Yes
DiscountPctdecimal(12,4)9
Yes
DistributionCodevarchar(10)10
Yes
PrintDescriptionvarchar(128)128
Yes
Quantity2decimal(12,4)9
Yes
Quantitydecimal(12,4)9
Yes
Ratedecimal(12,4)9
Yes
Foreign Keys FK_RevenueRatingImportedInvoiceDetail_RateType: [dbo].[RateTypes].RateTypeFIDRateTypeFIDint4
Yes
ImportDateTimedatetime8
Yes
OrdersFIDint4
Yes
Indexes IX_RevenueRatingImportedInvoiceDetail_CarrierBillingMinor: CarrierBillingMinorFIDCarrierBillingMinorFIDint4
Yes
CarrierBillingMajorFIDint4
Yes
Indexes Indexes
NameColumnsUnique
Primary Key PK_RevenueRatingImportedInvoiceDetail: RevenueRatingImportedInvoiceDetailIDPK_RevenueRatingImportedInvoiceDetailRevenueRatingImportedInvoiceDetailID
Yes
IX_RevenueRatingImportedInvoiceDetail_CarrierBillingMinorCarrierBillingMinorFID
Cluster Key IX_RevenueRatingImportedInvoiceDetailFID: RevenueRatingImportedHeaderFIDIX_RevenueRatingImportedInvoiceDetailFIDRevenueRatingImportedHeaderFID
Foreign Keys Foreign Keys
NameDeleteColumns
FK_RevenueRatingImportedInvoiceDetail_AgentAgentFID->[dbo].[Agent].[AgentPriKey]
FK_RevenueRatingImportedInvoiceDetail_RateTypeSetNullRateTypeFID->[dbo].[RateTypes].[RTypePriKey]
FK_RevenueRatingImportedInvoiceDetail_RevenueRatingImportedHeaderCascadeRevenueRatingImportedHeaderFID->[dbo].[RevenueRatingImportedHeader].[RevenueRatingImportedHeaderID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[RevenueRatingImportedInvoiceDetail]
(
[RevenueRatingImportedInvoiceDetailID] [int] NOT NULL IDENTITY(1, 1),
[RevenueRatingImportedHeaderFID] [int] NOT NULL,
[AgentFID] [int] NULL,
[Description] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[GrossAmount] [decimal] (12, 4) NULL,
[DiscountPct] [decimal] (12, 4) NULL,
[DistributionCode] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PrintDescription] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Quantity2] [decimal] (12, 4) NULL,
[Quantity] [decimal] (12, 4) NULL,
[Rate] [decimal] (12, 4) NULL,
[RateTypeFID] [int] NULL,
[ImportDateTime] [datetime] NULL,
[OrdersFID] [int] NULL,
[CarrierBillingMinorFID] [int] NULL,
[CarrierBillingMajorFID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[RevenueRatingImportedInvoiceDetail] ADD CONSTRAINT [PK_RevenueRatingImportedInvoiceDetail] PRIMARY KEY NONCLUSTERED  ([RevenueRatingImportedInvoiceDetailID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_RevenueRatingImportedInvoiceDetail_CarrierBillingMinor] ON [dbo].[RevenueRatingImportedInvoiceDetail] ([CarrierBillingMinorFID]) ON [PRIMARY]
GO
CREATE CLUSTERED INDEX [IX_RevenueRatingImportedInvoiceDetailFID] ON [dbo].[RevenueRatingImportedInvoiceDetail] ([RevenueRatingImportedHeaderFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[RevenueRatingImportedInvoiceDetail] ADD CONSTRAINT [FK_RevenueRatingImportedInvoiceDetail_Agent] FOREIGN KEY ([AgentFID]) REFERENCES [dbo].[Agent] ([AgentPriKey])
GO
ALTER TABLE [dbo].[RevenueRatingImportedInvoiceDetail] ADD CONSTRAINT [FK_RevenueRatingImportedInvoiceDetail_RateType] FOREIGN KEY ([RateTypeFID]) REFERENCES [dbo].[RateTypes] ([RTypePriKey]) ON DELETE SET NULL
GO
ALTER TABLE [dbo].[RevenueRatingImportedInvoiceDetail] ADD CONSTRAINT [FK_RevenueRatingImportedInvoiceDetail_RevenueRatingImportedHeader] FOREIGN KEY ([RevenueRatingImportedHeaderFID]) REFERENCES [dbo].[RevenueRatingImportedHeader] ([RevenueRatingImportedHeaderID]) ON DELETE CASCADE
GO
GRANT SELECT ON  [dbo].[RevenueRatingImportedInvoiceDetail] TO [MssExec]
GRANT INSERT ON  [dbo].[RevenueRatingImportedInvoiceDetail] TO [MssExec]
GRANT DELETE ON  [dbo].[RevenueRatingImportedInvoiceDetail] TO [MssExec]
GRANT UPDATE ON  [dbo].[RevenueRatingImportedInvoiceDetail] TO [MssExec]
GO
Uses
Used By