Tables [dbo].[QuoteDetail]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
HeapYes
Row Count (~)0
Created5:00:44 PM Monday, April 21, 2008
Last Modified7:27:33 PM Tuesday, June 11, 2024
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentityDefault
Primary Key PK_QuoteDetail: QuoteDetailIDIndexes IX_QuoteDetail_QuoteGroup: QuoteGroupFID\QuoteDetailIDQuoteDetailIDint4
No
1 - 1
Foreign Keys FK_QuoteDetail_QuoteGroup: [dbo].[QuoteGroup].QuoteGroupFIDIndexes IX_QuoteDetail_QuoteGroup: QuoteGroupFID\QuoteDetailIDQuoteGroupFIDint4
No
Foreign Keys FK_QuoteDetail_ItemCode: [dbo].[ItemCode].ItemCodeFIDItemCodeFIDint4
Yes
Foreign Keys FK_QuoteDetail_RateType: [dbo].[RateTypes].RateTypeFIDRateTypeFIDint4
Yes
Descriptionvarchar(128)128
No
Ratemoney8
Yes
Quantitydecimal(10,4)9
Yes
Quantity2decimal(10,4)9
Yes
Chargemoney8
Yes
Foreign Keys FK_QuoteDetail_QuoteServiceProviderType: [dbo].[QuoteServiceProviderType].QuoteServiceProviderTypeFIDQuoteServiceProviderTypeFIDint4
Yes
VendorIDvarchar(15)15
Yes
VendorQuotedChargemoney8
Yes
VendorActualChargemoney8
Yes
Hiddenbit1
No
((0))
SortOrderint4
Yes
PONumbervarchar(20)20
Yes
InvoiceNumbervarchar(20)20
Yes
ServiceDatedatetime8
Yes
NoteTextvarchar(1024)1024
Yes
Foreign Keys FK_QuoteDetail_LaborRatingTypeFID: [dbo].[LaborRatingType].LaborRatingTypeFIDLaborRatingTypeFIDint4
Yes
Foreign Keys FK_QuoteDetail_QuoteServiceProviderBillToFID: [dbo].[QuoteServiceProviderBillTo].QuoteServiceProviderBillToFIDQuoteServiceProviderBillToFIDint4
Yes
RateSourcevarchar(50)50
Yes
RateSourceRecordint4
Yes
CurrentRowVersiontimestamp8
No
ExternalVendorIDvarchar(15)15
Yes
ExternalVendorNamevarchar(40)40
Yes
IsLockedbit1
No
((0))
Indexes Indexes
NameColumnsUniqueFill Factor
Primary Key PK_QuoteDetail: QuoteDetailIDPK_QuoteDetailQuoteDetailID
Yes
80
IX_QuoteDetail_QuoteGroupQuoteGroupFID, QuoteDetailID
Yes
Check Constraints Check Constraints
NameConstraint
CK_QuoteDetail_ServiceProvider_Agent([QuoteServiceProviderTypeFID] IS NULL AND [VendorID] IS NULL OR [QuoteServiceProviderTypeFID] IS NULL AND [VendorID] IS NOT NULL OR [QuoteServiceProviderTypeFID] IS NOT NULL AND [VendorID] IS NULL)
Foreign Keys Foreign Keys
NameDeleteColumns
FK_QuoteDetail_ItemCodeItemCodeFID->[dbo].[ItemCode].[ICPriKey]
FK_QuoteDetail_LaborRatingTypeFIDLaborRatingTypeFID->[dbo].[LaborRatingType].[LaborRatingTypeID]
FK_QuoteDetail_QuoteGroupCascadeQuoteGroupFID->[dbo].[QuoteGroup].[QuoteGroupID]
FK_QuoteDetail_QuoteServiceProviderBillToFIDQuoteServiceProviderBillToFID->[dbo].[QuoteServiceProviderBillTo].[QuoteServiceProviderBillToID]
FK_QuoteDetail_QuoteServiceProviderTypeQuoteServiceProviderTypeFID->[dbo].[QuoteServiceProviderType].[QuoteServiceProviderTypeID]
FK_QuoteDetail_RateTypeRateTypeFID->[dbo].[RateTypes].[RTypePriKey]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[QuoteDetail]
(
[QuoteDetailID] [int] NOT NULL IDENTITY(1, 1),
[QuoteGroupFID] [int] NOT NULL,
[ItemCodeFID] [int] NULL,
[RateTypeFID] [int] NULL,
[Description] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Rate] [money] NULL,
[Quantity] [decimal] (10, 4) NULL,
[Quantity2] [decimal] (10, 4) NULL,
[Charge] [money] NULL,
[QuoteServiceProviderTypeFID] [int] NULL,
[VendorID] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[VendorQuotedCharge] [money] NULL,
[VendorActualCharge] [money] NULL,
[Hidden] [bit] NOT NULL CONSTRAINT [DF_QuoteDetail_Hidden] DEFAULT ((0)),
[SortOrder] [int] NULL,
[PONumber] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[InvoiceNumber] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ServiceDate] [datetime] NULL,
[NoteText] [varchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LaborRatingTypeFID] [int] NULL,
[QuoteServiceProviderBillToFID] [int] NULL,
[RateSource] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[RateSourceRecord] [int] NULL,
[CurrentRowVersion] [timestamp] NOT NULL,
[ExternalVendorID] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ExternalVendorName] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[IsLocked] [bit] NOT NULL CONSTRAINT [DF_QuoteDetail_IsLocked] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[QuoteDetail] ADD CONSTRAINT [CK_QuoteDetail_ServiceProvider_Agent] CHECK (([QuoteServiceProviderTypeFID] IS NULL AND [VendorID] IS NULL OR [QuoteServiceProviderTypeFID] IS NULL AND [VendorID] IS NOT NULL OR [QuoteServiceProviderTypeFID] IS NOT NULL AND [VendorID] IS NULL))
GO
ALTER TABLE [dbo].[QuoteDetail] ADD CONSTRAINT [PK_QuoteDetail] PRIMARY KEY NONCLUSTERED  ([QuoteDetailID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_QuoteDetail_QuoteGroup] ON [dbo].[QuoteDetail] ([QuoteGroupFID], [QuoteDetailID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[QuoteDetail] ADD CONSTRAINT [FK_QuoteDetail_ItemCode] FOREIGN KEY ([ItemCodeFID]) REFERENCES [dbo].[ItemCode] ([ICPriKey])
GO
ALTER TABLE [dbo].[QuoteDetail] ADD CONSTRAINT [FK_QuoteDetail_LaborRatingTypeFID] FOREIGN KEY ([LaborRatingTypeFID]) REFERENCES [dbo].[LaborRatingType] ([LaborRatingTypeID])
GO
ALTER TABLE [dbo].[QuoteDetail] ADD CONSTRAINT [FK_QuoteDetail_QuoteGroup] FOREIGN KEY ([QuoteGroupFID]) REFERENCES [dbo].[QuoteGroup] ([QuoteGroupID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[QuoteDetail] ADD CONSTRAINT [FK_QuoteDetail_QuoteServiceProviderBillToFID] FOREIGN KEY ([QuoteServiceProviderBillToFID]) REFERENCES [dbo].[QuoteServiceProviderBillTo] ([QuoteServiceProviderBillToID])
GO
ALTER TABLE [dbo].[QuoteDetail] ADD CONSTRAINT [FK_QuoteDetail_QuoteServiceProviderType] FOREIGN KEY ([QuoteServiceProviderTypeFID]) REFERENCES [dbo].[QuoteServiceProviderType] ([QuoteServiceProviderTypeID])
GO
ALTER TABLE [dbo].[QuoteDetail] ADD CONSTRAINT [FK_QuoteDetail_RateType] FOREIGN KEY ([RateTypeFID]) REFERENCES [dbo].[RateTypes] ([RTypePriKey])
GO
GRANT SELECT ON  [dbo].[QuoteDetail] TO [MssExec]
GRANT INSERT ON  [dbo].[QuoteDetail] TO [MssExec]
GRANT DELETE ON  [dbo].[QuoteDetail] TO [MssExec]
GRANT UPDATE ON  [dbo].[QuoteDetail] TO [MssExec]
GO
Uses
Used By