[dbo].[AgentConnectBranch]
CREATE TABLE [dbo].[AgentConnectBranch]
(
[AgentConnectBranchID] [int] NOT NULL IDENTITY(1, 1),
[AgentConnectFID] [int] NOT NULL,
[AgentBranchID] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[AgentBranchName] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[AgentID] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[AgentName] [nvarchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[PermitUploads] [bit] NOT NULL CONSTRAINT [DF_AgentConnectBranch_PermitUploads] DEFAULT ((0)),
[PermitDownloads] [bit] NOT NULL CONSTRAINT [DF_AgentConnectBranch_PermitDownloads] DEFAULT ((0)),
[ExternalCode] [nvarchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Inactive] [bit] NOT NULL CONSTRAINT [DF_AgentConnectBranch_Inactive] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AgentConnectBranch] ADD CONSTRAINT [PK_AgentConnectBranch] PRIMARY KEY CLUSTERED ([AgentConnectBranchID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AgentConnectBranch] ADD CONSTRAINT [IX_AgentConnectBranch_AgentConnect_ExternalCode] UNIQUE NONCLUSTERED ([AgentConnectFID], [ExternalCode]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AgentConnectBranch] ADD CONSTRAINT [FK_AgentConnectBranch_AgentConnect] FOREIGN KEY ([AgentConnectFID]) REFERENCES [dbo].[AgentConnect] ([AgentConnectID])
GO
GRANT SELECT ON [dbo].[AgentConnectBranch] TO [MssExec]
GRANT INSERT ON [dbo].[AgentConnectBranch] TO [MssExec]
GRANT DELETE ON [dbo].[AgentConnectBranch] TO [MssExec]
GRANT UPDATE ON [dbo].[AgentConnectBranch] TO [MssExec]
GO