Tables [dbo].[SCContractLeases]
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)0
Created12:59:13 AM Thursday, March 21, 2019
Last Modified1:15:05 AM Thursday, March 21, 2019
KeyNameData TypeMax Length (Bytes)Allow NullsIdentityDefault
Cluster Primary Key PK__SCContra__80D303B775FABE7F: ContractLeaseIDContractLeaseIDint4
False
1 - 1
LeaseNumbervarchar(32)32
False
Foreign Keys FK_SCContractLeases_LeaseCodeID_SCLeaseCodes: [dbo].[SCLeaseCodes].LeaseCodeIDLeaseCodeIDint4
False
Termint4
False
DepositAmountmoney8
False
FinancedAmountmoney8
False
PaymentAmountmoney8
False
InterestRatedecimal(16,6)9
False
Foreign Keys FK_SCContractLeases_GLAccountID_GLAccounts: [dbo].[GLAccounts].GLAccountIDGLAccountIDint4
True
Foreign Keys FK_SCContractLeases_GLDeptID_GLDepts: [dbo].[GLDepts].GLDeptIDGLDeptIDint4
True
TaxFlagint4
True
Inventorymoney8
False
Purchasesmoney8
False
TerminationDatedatetime8
True
StartDatedatetime8
False
TerminationCodeIDint4
True
BuyoutLeaseIDint4
True
Notesvarchar(512)512
True
PayoffBeforeDepositmoney8
True
DepositReturnedmoney8
True
GLAdjustmentsCompletedDatedatetime8
True
Lockedbit1
False
((0))
Activebit1
False
((1))
CreatorIDchar(8)8
False
UpdatorIDchar(8)8
False
CreateDatedatetime8
False
(getdate())
LastUpdatedatetime8
False
(getdate())
timestamptimestamp8
True
Foreign Keys FK_SCContractLeases_LeaseCompanyID_ARCustomers: [dbo].[ARCustomers].LeaseCompanyIDLeaseCompanyIDint4
False
Foreign Keys FK_SCContractLeases_CustomerID_ARCustomers: [dbo].[ARCustomers].CustomerIDCustomerIDint4
False
DBFileHeaderIDint4
False
((1))
Foreign Keys FK_SCContractLeases_NoteID_SCContractLeaseNotes: [dbo].[SCContractLeaseNotes].NoteIDNoteIDint4
True
NoteFlagint4
False
((0))
UseIndividualTaxCodesbit1
False
((0))
SumIndividualAmountsbit1
False
((0))
NoteCountint4
False
((0))
Foreign Keys FK_SCContractLeases_TaxFlagID_ShTaxFlags: [dbo].[ShTaxFlags].TaxFlagIDTaxFlagIDint4
True
KeyNameKey ColumnsUniqueFill Factor
Cluster Primary Key PK__SCContra__80D303B775FABE7F: ContractLeaseIDPK__SCContra__80D303B775FABE7FContractLeaseID
True
80
NameNo CheckColumns
FK_SCContractLeases_CustomerID_ARCustomers
True
CustomerID->[dbo].[ARCustomers].[CustomerID]
FK_SCContractLeases_GLAccountID_GLAccountsGLAccountID->[dbo].[GLAccounts].[AccountID]
FK_SCContractLeases_GLDeptID_GLDeptsGLDeptID->[dbo].[GLDepts].[DeptID]
FK_SCContractLeases_LeaseCodeID_SCLeaseCodesLeaseCodeID->[dbo].[SCLeaseCodes].[LeaseCodeID]
FK_SCContractLeases_LeaseCompanyID_ARCustomers
True
LeaseCompanyID->[dbo].[ARCustomers].[CustomerID]
FK_SCContractLeases_NoteID_SCContractLeaseNotesNoteID->[dbo].[SCContractLeaseNotes].[NoteID]
FK_SCContractLeases_TaxFlagID_ShTaxFlagsTaxFlagID->[dbo].[ShTaxFlags].[TaxFlagID]
CREATE TABLE [dbo].[SCContractLeases]
(
[ContractLeaseID] [int] NOT NULL IDENTITY(1, 1),
[LeaseNumber] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[LeaseCodeID] [int] NOT NULL,
[Term] [int] NOT NULL,
[DepositAmount] [money] NOT NULL,
[FinancedAmount] [money] NOT NULL,
[PaymentAmount] [money] NOT NULL,
[InterestRate] [decimal] (16, 6) NOT NULL,
[GLAccountID] [int] NULL,
[GLDeptID] [int] NULL,
[TaxFlag] [int] NULL,
[Inventory] [money] NOT NULL,
[Purchases] [money] NOT NULL,
[TerminationDate] [datetime] NULL,
[StartDate] [datetime] NOT NULL,
[TerminationCodeID] [int] NULL,
[BuyoutLeaseID] [int] NULL,
[Notes] [varchar] (512) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[PayoffBeforeDeposit] [money] NULL,
[DepositReturned] [money] NULL,
[GLAdjustmentsCompletedDate] [datetime] NULL,
[Locked] [bit] NOT NULL CONSTRAINT [DF_SCContractLeases_Locked] DEFAULT ((0)),
[Active] [bit] NOT NULL CONSTRAINT [DF_SCContractLeases_Active] DEFAULT ((1)),
[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_SCContractLeases_CreateDate] DEFAULT (getdate()),
[LastUpdate] [datetime] NOT NULL CONSTRAINT [DF_SCContractLeases_LastUpdate] DEFAULT (getdate()),
[timestamp] [timestamp] NULL,
[LeaseCompanyID] [int] NOT NULL,
[CustomerID] [int] NOT NULL,
[DBFileHeaderID] [int] NOT NULL CONSTRAINT [DF_SCContractLeases_DBFileHeaderID] DEFAULT ((1)),
[NoteID] [int] NULL,
[NoteFlag] [int] NOT NULL CONSTRAINT [DF_SCContractLeases_NoteFlag] DEFAULT ((0)),
[UseIndividualTaxCodes] [bit] NOT NULL CONSTRAINT [DF_SCContractLeases_UseIndividualTaxCodes] DEFAULT ((0)),
[SumIndividualAmounts] [bit] NOT NULL CONSTRAINT [DF_SCContractLeases_SumIndividualAmounts] DEFAULT ((0)),
[NoteCount] [int] NOT NULL CONSTRAINT [DF_SCContractLeases_NoteCount] DEFAULT ((0)),
[TaxFlagID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SCContractLeases] ADD CONSTRAINT [PK__SCContra__80D303B775FABE7F] PRIMARY KEY CLUSTERED  ([ContractLeaseID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SCContractLeases] WITH NOCHECK ADD CONSTRAINT [FK_SCContractLeases_CustomerID_ARCustomers] FOREIGN KEY ([CustomerID]) REFERENCES [dbo].[ARCustomers] ([CustomerID])
GO
ALTER TABLE [dbo].[SCContractLeases] ADD CONSTRAINT [FK_SCContractLeases_GLAccountID_GLAccounts] FOREIGN KEY ([GLAccountID]) REFERENCES [dbo].[GLAccounts] ([AccountID])
GO
ALTER TABLE [dbo].[SCContractLeases] ADD CONSTRAINT [FK_SCContractLeases_GLDeptID_GLDepts] FOREIGN KEY ([GLDeptID]) REFERENCES [dbo].[GLDepts] ([DeptID])
GO
ALTER TABLE [dbo].[SCContractLeases] ADD CONSTRAINT [FK_SCContractLeases_LeaseCodeID_SCLeaseCodes] FOREIGN KEY ([LeaseCodeID]) REFERENCES [dbo].[SCLeaseCodes] ([LeaseCodeID])
GO
ALTER TABLE [dbo].[SCContractLeases] WITH NOCHECK ADD CONSTRAINT [FK_SCContractLeases_LeaseCompanyID_ARCustomers] FOREIGN KEY ([LeaseCompanyID]) REFERENCES [dbo].[ARCustomers] ([CustomerID])
GO
ALTER TABLE [dbo].[SCContractLeases] ADD CONSTRAINT [FK_SCContractLeases_NoteID_SCContractLeaseNotes] FOREIGN KEY ([NoteID]) REFERENCES [dbo].[SCContractLeaseNotes] ([NoteID])
GO
ALTER TABLE [dbo].[SCContractLeases] ADD CONSTRAINT [FK_SCContractLeases_TaxFlagID_ShTaxFlags] FOREIGN KEY ([TaxFlagID]) REFERENCES [dbo].[ShTaxFlags] ([TaxFlagID])
GO