Tables [dbo].[Branch]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CI_AS
Row Count (~)65
Created3:35:17 PM Tuesday, May 8, 2012
Last Modified7:36:50 PM Thursday, August 29, 2024
Columns
NameData TypeMax Length (Bytes)Allow NullsIdentity
Indexes IX_Branch_BranchID: BranchIDBranchIDvarchar(5)5
No
Namevarchar(30)30
No
Foreign Keys FK_BRANCH_Agent: [dbo].[Agent].AgentPriKeyIndexes IX_Branch_AgentPriKey: AgentPriKeyAgentPriKeyint4
Yes
Prefixvarchar(4)4
Yes
Sequenceint4
Yes
GLCodevarchar(10)10
Yes
Foreign Keys FK_BRANCH_GLControl: [dbo].[GLControl].GLCPriKeyGLCPriKeyint4
Yes
Cluster Primary Key PK_Branch: BranchPriKeyBranchPriKeyint4
No
1 - 1
Foreign Keys FK_BRANCH_VANLINE: [dbo].[VanLine].VLPriKeyVLPriKeyint4
No
CompanyGLCodevarchar(10)10
Yes
CommonViewvarchar(4)4
Yes
ImageURLvarchar(2048)2048
Yes
DOTvarchar(50)50
Yes
AdvanceCompanyNumbervarchar(32)32
Yes
AdvanceFTPHostDirectoryvarchar(64)64
Yes
Foreign Keys FK_Branch_AuthorityType: [dbo].[AuthorityTypes].AuthorityTypeFIDIndexes IX_Branch_AuthorityType: AuthorityTypeFIDAuthorityTypeFIDint4
No
SalesTaxCompanyCodevarchar(25)25
Yes
CostBenefitsPercentagedecimal(14,4)9
Yes
DefaultDriveTimedecimal(10,2)9
Yes
Foreign Keys FK_BRANCH_LaborRatingGroup: [dbo].[LaborRatingGroup].LaborRatingGroupFIDLaborRatingGroupFIDint4
Yes
Foreign Keys FK_branch_MssTimeZone: [dbo].[MssTimeZone].MssTimeZoneFIDMssTimeZoneFIDint4
Yes
EmailFromAddressnvarchar(120)240
Yes
EmailFromNamenvarchar(120)240
Yes
Indexes Indexes
NameColumnsUnique
Cluster Primary Key PK_Branch: BranchPriKeyPK_BranchBranchPriKey
Yes
IX_Branch_AgentPriKeyAgentPriKey
Yes
IX_Branch_BranchIDBranchID
Yes
IX_Branch_AuthorityTypeAuthorityTypeFID
Foreign Keys Foreign Keys
NameColumns
FK_BRANCH_AgentAgentPriKey->[dbo].[Agent].[AgentPriKey]
FK_Branch_AuthorityTypeAuthorityTypeFID->[dbo].[AuthorityTypes].[AuthPriKey]
FK_BRANCH_GLControlGLCPriKey->[dbo].[GLControl].[GLCPriKey]
FK_BRANCH_LaborRatingGroupLaborRatingGroupFID->[dbo].[LaborRatingGroup].[LaborRatingGroupID]
FK_branch_MssTimeZoneMssTimeZoneFID->[dbo].[MssTimeZone].[MssTimeZoneID]
FK_BRANCH_VANLINEVLPriKey->[dbo].[VanLine].[VLPriKey]
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
CREATE TABLE [dbo].[Branch]
(
[BranchID] [varchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Name] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[AgentPriKey] [int] NULL,
[Prefix] [varchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Sequence] [int] NULL,
[GLCode] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[GLCPriKey] [int] NULL,
[BranchPriKey] [int] NOT NULL IDENTITY(1, 1),
[VLPriKey] [int] NOT NULL,
[CompanyGLCode] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CommonView] [varchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ImageURL] [varchar] (2048) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[DOT] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[AdvanceCompanyNumber] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[AdvanceFTPHostDirectory] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[AuthorityTypeFID] [int] NOT NULL,
[SalesTaxCompanyCode] [varchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CostBenefitsPercentage] [decimal] (14, 4) NULL,
[DefaultDriveTime] [decimal] (10, 2) NULL,
[LaborRatingGroupFID] [int] NULL,
[MssTimeZoneFID] [int] NULL,
[EmailFromAddress] [nvarchar] (120) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[EmailFromName] [nvarchar] (120) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Branch] ADD CONSTRAINT [PK_Branch] PRIMARY KEY CLUSTERED  ([BranchPriKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Branch] ADD CONSTRAINT [IX_Branch_AgentPriKey] UNIQUE NONCLUSTERED  ([AgentPriKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Branch] ADD CONSTRAINT [IX_Branch_BranchID] UNIQUE NONCLUSTERED  ([BranchID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_Branch_AuthorityType] ON [dbo].[Branch] ([AuthorityTypeFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Branch] ADD CONSTRAINT [FK_BRANCH_Agent] FOREIGN KEY ([AgentPriKey]) REFERENCES [dbo].[Agent] ([AgentPriKey])
GO
ALTER TABLE [dbo].[Branch] ADD CONSTRAINT [FK_Branch_AuthorityType] FOREIGN KEY ([AuthorityTypeFID]) REFERENCES [dbo].[AuthorityTypes] ([AuthPriKey])
GO
ALTER TABLE [dbo].[Branch] ADD CONSTRAINT [FK_BRANCH_GLControl] FOREIGN KEY ([GLCPriKey]) REFERENCES [dbo].[GLControl] ([GLCPriKey])
GO
ALTER TABLE [dbo].[Branch] ADD CONSTRAINT [FK_BRANCH_LaborRatingGroup] FOREIGN KEY ([LaborRatingGroupFID]) REFERENCES [dbo].[LaborRatingGroup] ([LaborRatingGroupID])
GO
ALTER TABLE [dbo].[Branch] ADD CONSTRAINT [FK_branch_MssTimeZone] FOREIGN KEY ([MssTimeZoneFID]) REFERENCES [dbo].[MssTimeZone] ([MssTimeZoneID])
GO
ALTER TABLE [dbo].[Branch] ADD CONSTRAINT [FK_BRANCH_VANLINE] FOREIGN KEY ([VLPriKey]) REFERENCES [dbo].[VanLine] ([VLPriKey])
GO
GRANT SELECT ON  [dbo].[Branch] TO [MssExec]
GRANT INSERT ON  [dbo].[Branch] TO [MssExec]
GRANT DELETE ON  [dbo].[Branch] TO [MssExec]
GRANT UPDATE ON  [dbo].[Branch] TO [MssExec]
GO
Uses
Used By