Tables [dbo].[InvoiceRequirement]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)0
Created5:00:23 PM Monday, April 21, 2008
Last Modified11:13:39 AM Monday, August 19, 2013
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Primary Key PK_InvoiceRequirement: InvoiceRequirementIDInvoiceRequirementIDint4
No
1 - 1
Cluster Key IX_InvoiceRequirement_Customer: CustomerNumberIndexes IX_InvoiceRequirement_Customer_Authority_Branch: CustomerNumber\AuthorityTypeFID\BranchFIDCustomerNumbervarchar(15)15
No
Foreign Keys FK_InvoiceRequirement_AuthorityTypes: [dbo].[AuthorityTypes].AuthorityTypeFIDIndexes IX_InvoiceRequirement_AuthorityType: AuthorityTypeFIDIndexes IX_InvoiceRequirement_Customer_Authority_Branch: CustomerNumber\AuthorityTypeFID\BranchFIDAuthorityTypeFIDint4
No
Foreign Keys FK_InvoiceRequirement_Branch: [dbo].[Branch].BranchFIDIndexes IX_InvoiceRequirement_Branch: BranchFIDIndexes IX_InvoiceRequirement_Customer_Authority_Branch: CustomerNumber\AuthorityTypeFID\BranchFIDBranchFIDint4
No
Foreign Keys FK_InvoiceRequirement_InvoiceRequirementType: [dbo].[InvoiceRequirementType].InvoiceRequirementTypeFIDInvoiceRequirementTypeFIDint4
No
Indexes Indexes
NameColumnsUniqueFill Factor
Primary Key PK_InvoiceRequirement: InvoiceRequirementIDPK_InvoiceRequirementInvoiceRequirementID
Yes
80
IX_InvoiceRequirement_Customer_Authority_BranchCustomerNumber, AuthorityTypeFID, BranchFID
Yes
80
IX_InvoiceRequirement_AuthorityTypeAuthorityTypeFID80
IX_InvoiceRequirement_BranchBranchFID80
Cluster Key IX_InvoiceRequirement_Customer: CustomerNumberIX_InvoiceRequirement_CustomerCustomerNumber80
Foreign Keys Foreign Keys
NameColumns
FK_InvoiceRequirement_AuthorityTypesAuthorityTypeFID->[dbo].[AuthorityTypes].[AuthPriKey]
FK_InvoiceRequirement_BranchBranchFID->[dbo].[Branch].[BranchPriKey]
FK_InvoiceRequirement_InvoiceRequirementTypeInvoiceRequirementTypeFID->[dbo].[InvoiceRequirementType].[InvoiceRequirementTypeID]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[InvoiceRequirement]
(
[InvoiceRequirementID] [int] NOT NULL IDENTITY(1, 1),
[CustomerNumber] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[AuthorityTypeFID] [int] NOT NULL,
[BranchFID] [int] NOT NULL,
[InvoiceRequirementTypeFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InvoiceRequirement] ADD CONSTRAINT [PK_InvoiceRequirement] PRIMARY KEY NONCLUSTERED  ([InvoiceRequirementID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InvoiceRequirement] ADD CONSTRAINT [IX_InvoiceRequirement_Customer_Authority_Branch] UNIQUE NONCLUSTERED  ([CustomerNumber], [AuthorityTypeFID], [BranchFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_InvoiceRequirement_AuthorityType] ON [dbo].[InvoiceRequirement] ([AuthorityTypeFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_InvoiceRequirement_Branch] ON [dbo].[InvoiceRequirement] ([BranchFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE CLUSTERED INDEX [IX_InvoiceRequirement_Customer] ON [dbo].[InvoiceRequirement] ([CustomerNumber]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InvoiceRequirement] ADD CONSTRAINT [FK_InvoiceRequirement_AuthorityTypes] FOREIGN KEY ([AuthorityTypeFID]) REFERENCES [dbo].[AuthorityTypes] ([AuthPriKey])
GO
ALTER TABLE [dbo].[InvoiceRequirement] ADD CONSTRAINT [FK_InvoiceRequirement_Branch] FOREIGN KEY ([BranchFID]) REFERENCES [dbo].[Branch] ([BranchPriKey])
GO
ALTER TABLE [dbo].[InvoiceRequirement] ADD CONSTRAINT [FK_InvoiceRequirement_InvoiceRequirementType] FOREIGN KEY ([InvoiceRequirementTypeFID]) REFERENCES [dbo].[InvoiceRequirementType] ([InvoiceRequirementTypeID])
GO
GRANT SELECT ON  [dbo].[InvoiceRequirement] TO [MssExec]
GRANT INSERT ON  [dbo].[InvoiceRequirement] TO [MssExec]
GRANT DELETE ON  [dbo].[InvoiceRequirement] TO [MssExec]
GRANT UPDATE ON  [dbo].[InvoiceRequirement] TO [MssExec]
GO
Uses