Tables [dbo].[SOQuotes]
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)0
Created12:55:54 AM Thursday, March 21, 2019
Last Modified1:16:18 AM Thursday, March 21, 2019
KeyNameData TypeMax Length (Bytes)Allow NullsDefault
Cluster Primary Key PK_SOQuotes: QuoteIDQuoteIDint4
False
QuoteNumbervarchar(15)15
False
Foreign Keys FK_SOQuotes_CustomerID_ARCustomers: [dbo].[ARCustomers].CustomerIDCustomerIDint4
True
Foreign Keys FK_SOQuotes_BillToID_ARCustomers: [dbo].[ARCustomers].BillToIDBillToIDint4
True
Foreign Keys FK_SOQuotes_LocationID_ARCustomers: [dbo].[ARCustomers].LocationIDLocationIDint4
True
Datedatetime8
False
Descriptionvarchar(255)255
False
PONumbervarchar(32)32
False
ReqDatedatetime8
True
Foreign Keys FK_SOQuotes_TermID_ShTerms: [dbo].[ShTerms].TermIDTermIDint4
True
TermDiscountRatefloat8
False
TermDiscountDatedatetime8
True
DueDatedatetime8
False
Foreign Keys FK_SOQuotes_ShipMethodID_ShShipMethods: [dbo].[ShShipMethods].ShipMethodIDShipMethodIDint4
True
Foreign Keys FK_SOQuotes_SalesRepID_ARSalesReps: [dbo].[ARSalesReps].SalesRepIDSalesRepIDint4
True
MailToAttnvarchar(64)64
False
MailToNamevarchar(128)128
False
MailToAddressvarchar(64)64
False
MailToCityvarchar(32)32
False
MailToStatevarchar(16)16
False
MailToZipvarchar(16)16
False
MailToCountryvarchar(16)16
False
ShipToAttnvarchar(64)64
False
ShipToNamevarchar(128)128
False
ShipToAddressvarchar(64)64
False
ShipToCityvarchar(32)32
False
ShipToStatevarchar(16)16
False
ShipToZipvarchar(16)16
False
ShipToCountryvarchar(16)16
False
Remarksvarchar(1024)1024
False
DiscountRatedecimal(18,6)9
False
Foreign Keys FK_SOQuotes_DiscountGLID_GLAccounts: [dbo].[GLAccounts].DiscountGLIDDiscountGLIDint4
True
Discountmoney8
False
((0))
Foreign Keys FK_SOQuotes_FreightGLID_GLAccounts: [dbo].[GLAccounts].FreightGLIDFreightGLIDint4
True
Freightmoney8
False
((0))
Foreign Keys FK_SOQuotes_TaxCodeID_ShTaxCodes: [dbo].[ShTaxCodes].TaxCodeIDTaxCodeIDint4
True
Taxmoney8
False
((0))
Foreign Keys FK_SOQuotes_GLID_GLAccounts: [dbo].[GLAccounts].GLIDGLIDint4
True
Totalmoney8
False
((0))
UnShippedDiscountmoney8
False
((0))
UnShippedTaxmoney8
False
((0))
UnShippedmoney8
False
((0))
UnBilledFreightmoney8
False
((0))
Activebit1
False
ExpirationDatedatetime8
True
OriginatorEMailvarchar(255)255
True
Foreign Keys FK_SOQuotes_OriginationID_SOQuoteOrigination: [dbo].[SOQuoteOrigination].OriginationIDOriginationIDint4
True
((0))
TurnedIntoOrderbit1
False
((0))
CreatorIDchar(8)8
False
UpdatorIDchar(8)8
False
CreateDatedatetime8
False
(getdate())
LastUpdatedatetime8
False
(getdate())
timestamptimestamp8
False
Foreign Keys FK_SOQuotes_BranchID_GLBranches: [dbo].[GLBranches].BranchIDBranchIDint4
False
Foreign Keys FK_SOQuotes_ARBranchID_GLBranches: [dbo].[GLBranches].ARBranchIDARBranchIDint4
False
Taxablebit1
False
((1))
Foreign Keys FK_SOQuotes_NoteID_SOQuoteNotes: [dbo].[SOQuoteNotes].NoteIDNoteIDint4
True
NoteFlagint4
False
((0))
Foreign Keys FK_SOQuotes_OrderedByContactID_CMContacts: [dbo].[CMContacts].OrderedByContactIDOrderedByContactIDint4
True
NoteCountint4
False
((0))
SendShippingNotificationsbit1
False
((0))
SendShippingNotificationToOrderByContactbit1
False
((0))
ShippingNotificationAdditionalEmailsvarchar(1024)1024
False
('')
Foreign Keys FK_SOQuotes_TaxExemptCodeID_SHTaxExemptCodes: [dbo].[SHTaxExemptCodes].TaxExemptCodeIDTaxExemptCodeIDint4
True
FreightTaxFlagint4
False
Foreign Keys FK_SOQuotes_FreightTaxFlagID_ShTaxFlags: [dbo].[ShTaxFlags].FreightTaxFlagIDFreightTaxFlagIDint4
False
KeyNameKey ColumnsUniqueFill Factor
Cluster Primary Key PK_SOQuotes: QuoteIDPK_SOQuotesQuoteID
True
80
NameNo CheckColumns
FK_SOQuotes_ARBranchID_GLBranchesARBranchID->[dbo].[GLBranches].[BranchID]
FK_SOQuotes_BillToID_ARCustomers
True
BillToID->[dbo].[ARCustomers].[CustomerID]
FK_SOQuotes_BranchID_GLBranchesBranchID->[dbo].[GLBranches].[BranchID]
FK_SOQuotes_CustomerID_ARCustomers
True
CustomerID->[dbo].[ARCustomers].[CustomerID]
FK_SOQuotes_DiscountGLID_GLAccountsDiscountGLID->[dbo].[GLAccounts].[AccountID]
FK_SOQuotes_FreightGLID_GLAccountsFreightGLID->[dbo].[GLAccounts].[AccountID]
FK_SOQuotes_FreightTaxFlagID_ShTaxFlagsFreightTaxFlagID->[dbo].[ShTaxFlags].[TaxFlagID]
FK_SOQuotes_GLID_GLAccountsGLID->[dbo].[GLAccounts].[AccountID]
FK_SOQuotes_LocationID_ARCustomers
True
LocationID->[dbo].[ARCustomers].[CustomerID]
FK_SOQuotes_NoteID_SOQuoteNotesNoteID->[dbo].[SOQuoteNotes].[NoteID]
FK_SOQuotes_OrderedByContactID_CMContactsOrderedByContactID->[dbo].[CMContacts].[ContactID]
FK_SOQuotes_OriginationID_SOQuoteOriginationOriginationID->[dbo].[SOQuoteOrigination].[OriginationID]
FK_SOQuotes_SalesRepID_ARSalesRepsSalesRepID->[dbo].[ARSalesReps].[SalesRepID]
FK_SOQuotes_ShipMethodID_ShShipMethodsShipMethodID->[dbo].[ShShipMethods].[ShipMethodID]
FK_SOQuotes_TaxCodeID_ShTaxCodesTaxCodeID->[dbo].[ShTaxCodes].[TaxCodeID]
FK_SOQuotes_TaxExemptCodeID_SHTaxExemptCodesTaxExemptCodeID->[dbo].[SHTaxExemptCodes].[TaxExemptCodeID]
FK_SOQuotes_TermID_ShTermsTermID->[dbo].[ShTerms].[TermID]
CREATE TABLE [dbo].[SOQuotes]
(
[QuoteID] [int] NOT NULL,
[QuoteNumber] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CustomerID] [int] NULL,
[BillToID] [int] NULL,
[LocationID] [int] NULL,
[Date] [datetime] NOT NULL,
[Description] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[PONumber] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ReqDate] [datetime] NULL,
[TermID] [int] NULL,
[TermDiscountRate] [float] NOT NULL,
[TermDiscountDate] [datetime] NULL,
[DueDate] [datetime] NOT NULL,
[ShipMethodID] [int] NULL,
[SalesRepID] [int] NULL,
[MailToAttn] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[MailToName] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[MailToAddress] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[MailToCity] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[MailToState] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[MailToZip] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[MailToCountry] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ShipToAttn] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ShipToName] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ShipToAddress] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ShipToCity] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ShipToState] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ShipToZip] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ShipToCountry] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Remarks] [varchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[DiscountRate] [decimal] (18, 6) NOT NULL,
[DiscountGLID] [int] NULL,
[Discount] [money] NOT NULL CONSTRAINT [DF_SOQuotes_Discount] DEFAULT ((0)),
[FreightGLID] [int] NULL,
[Freight] [money] NOT NULL CONSTRAINT [DF_SOQuotes_Freight] DEFAULT ((0)),
[TaxCodeID] [int] NULL,
[Tax] [money] NOT NULL CONSTRAINT [DF_SOQuotes_Tax] DEFAULT ((0)),
[GLID] [int] NULL,
[Total] [money] NOT NULL CONSTRAINT [DF_SOQuotes_Total] DEFAULT ((0)),
[UnShippedDiscount] [money] NOT NULL CONSTRAINT [DF_SOQuotes_UnShippedDiscount] DEFAULT ((0)),
[UnShippedTax] [money] NOT NULL CONSTRAINT [DF_SOQuotes_UnShippedTax] DEFAULT ((0)),
[UnShipped] [money] NOT NULL CONSTRAINT [DF_SOQuotes_UnShipped] DEFAULT ((0)),
[UnBilledFreight] [money] NOT NULL CONSTRAINT [DF_SOQuotes_UnBilledFreight] DEFAULT ((0)),
[Active] [bit] NOT NULL,
[ExpirationDate] [datetime] NULL,
[OriginatorEMail] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[OriginationID] [int] NULL CONSTRAINT [DF_SOQuotes_OriginationID] DEFAULT ((0)),
[TurnedIntoOrder] [bit] NOT NULL CONSTRAINT [DF_SOQuotes_TurnedIntoOrder] DEFAULT ((0)),
[CreatorID] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[UpdatorID] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CreateDate] [datetime] NOT NULL CONSTRAINT [DF_SOQuotes_CreateDate] DEFAULT (getdate()),
[LastUpdate] [datetime] NOT NULL CONSTRAINT [DF_SOQuotes_LastUpdate] DEFAULT (getdate()),
[timestamp] [timestamp] NOT NULL,
[BranchID] [int] NOT NULL,
[ARBranchID] [int] NOT NULL,
[Taxable] [bit] NOT NULL CONSTRAINT [DF_SOQuotes_Taxable] DEFAULT ((1)),
[NoteID] [int] NULL,
[NoteFlag] [int] NOT NULL CONSTRAINT [DF_SOQuotes_NoteFlag] DEFAULT ((0)),
[OrderedByContactID] [int] NULL,
[NoteCount] [int] NOT NULL CONSTRAINT [DF_SOQuotes_NoteCount] DEFAULT ((0)),
[SendShippingNotifications] [bit] NOT NULL CONSTRAINT [DF_SOQuotes_SendShippingNotifications] DEFAULT ((0)),
[SendShippingNotificationToOrderByContact] [bit] NOT NULL CONSTRAINT [DF_SOQuotes_SendShippingNotificationToOrderByContact] DEFAULT ((0)),
[ShippingNotificationAdditionalEmails] [varchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_SOQuotes_ShippingNotificationAdditionalEmails] DEFAULT (''),
[TaxExemptCodeID] [int] NULL,
[FreightTaxFlag] [int] NOT NULL,
[FreightTaxFlagID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SOQuotes] ADD CONSTRAINT [PK_SOQuotes] PRIMARY KEY CLUSTERED  ([QuoteID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SOQuotes] ADD CONSTRAINT [FK_SOQuotes_ARBranchID_GLBranches] FOREIGN KEY ([ARBranchID]) REFERENCES [dbo].[GLBranches] ([BranchID])
GO
ALTER TABLE [dbo].[SOQuotes] WITH NOCHECK ADD CONSTRAINT [FK_SOQuotes_BillToID_ARCustomers] FOREIGN KEY ([BillToID]) REFERENCES [dbo].[ARCustomers] ([CustomerID])
GO
ALTER TABLE [dbo].[SOQuotes] ADD CONSTRAINT [FK_SOQuotes_BranchID_GLBranches] FOREIGN KEY ([BranchID]) REFERENCES [dbo].[GLBranches] ([BranchID])
GO
ALTER TABLE [dbo].[SOQuotes] WITH NOCHECK ADD CONSTRAINT [FK_SOQuotes_CustomerID_ARCustomers] FOREIGN KEY ([CustomerID]) REFERENCES [dbo].[ARCustomers] ([CustomerID])
GO
ALTER TABLE [dbo].[SOQuotes] ADD CONSTRAINT [FK_SOQuotes_DiscountGLID_GLAccounts] FOREIGN KEY ([DiscountGLID]) REFERENCES [dbo].[GLAccounts] ([AccountID])
GO
ALTER TABLE [dbo].[SOQuotes] ADD CONSTRAINT [FK_SOQuotes_FreightGLID_GLAccounts] FOREIGN KEY ([FreightGLID]) REFERENCES [dbo].[GLAccounts] ([AccountID])
GO
ALTER TABLE [dbo].[SOQuotes] ADD CONSTRAINT [FK_SOQuotes_FreightTaxFlagID_ShTaxFlags] FOREIGN KEY ([FreightTaxFlagID]) REFERENCES [dbo].[ShTaxFlags] ([TaxFlagID])
GO
ALTER TABLE [dbo].[SOQuotes] ADD CONSTRAINT [FK_SOQuotes_GLID_GLAccounts] FOREIGN KEY ([GLID]) REFERENCES [dbo].[GLAccounts] ([AccountID])
GO
ALTER TABLE [dbo].[SOQuotes] WITH NOCHECK ADD CONSTRAINT [FK_SOQuotes_LocationID_ARCustomers] FOREIGN KEY ([LocationID]) REFERENCES [dbo].[ARCustomers] ([CustomerID])
GO
ALTER TABLE [dbo].[SOQuotes] ADD CONSTRAINT [FK_SOQuotes_NoteID_SOQuoteNotes] FOREIGN KEY ([NoteID]) REFERENCES [dbo].[SOQuoteNotes] ([NoteID])
GO
ALTER TABLE [dbo].[SOQuotes] ADD CONSTRAINT [FK_SOQuotes_OrderedByContactID_CMContacts] FOREIGN KEY ([OrderedByContactID]) REFERENCES [dbo].[CMContacts] ([ContactID])
GO
ALTER TABLE [dbo].[SOQuotes] ADD CONSTRAINT [FK_SOQuotes_OriginationID_SOQuoteOrigination] FOREIGN KEY ([OriginationID]) REFERENCES [dbo].[SOQuoteOrigination] ([OriginationID])
GO
ALTER TABLE [dbo].[SOQuotes] ADD CONSTRAINT [FK_SOQuotes_SalesRepID_ARSalesReps] FOREIGN KEY ([SalesRepID]) REFERENCES [dbo].[ARSalesReps] ([SalesRepID])
GO
ALTER TABLE [dbo].[SOQuotes] ADD CONSTRAINT [FK_SOQuotes_ShipMethodID_ShShipMethods] FOREIGN KEY ([ShipMethodID]) REFERENCES [dbo].[ShShipMethods] ([ShipMethodID])
GO
ALTER TABLE [dbo].[SOQuotes] ADD CONSTRAINT [FK_SOQuotes_TaxCodeID_ShTaxCodes] FOREIGN KEY ([TaxCodeID]) REFERENCES [dbo].[ShTaxCodes] ([TaxCodeID])
GO
ALTER TABLE [dbo].[SOQuotes] ADD CONSTRAINT [FK_SOQuotes_TaxExemptCodeID_SHTaxExemptCodes] FOREIGN KEY ([TaxExemptCodeID]) REFERENCES [dbo].[SHTaxExemptCodes] ([TaxExemptCodeID])
GO
ALTER TABLE [dbo].[SOQuotes] ADD CONSTRAINT [FK_SOQuotes_TermID_ShTerms] FOREIGN KEY ([TermID]) REFERENCES [dbo].[ShTerms] ([TermID])
GO