CREATE TABLE [dbo].[SHAgentCustomProperties]
(
[AgentCustomPropertyID] [int] NOT NULL IDENTITY(1, 1),
[AgentID] [int] NOT NULL,
[ShAttributeID] [int] NOT NULL,
[IDVal] [int] NULL,
[TextVal] [varchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Required] [bit] NOT NULL CONSTRAINT [DF_SHAgentCustomProperties_Required] DEFAULT ((0)),
[CreatorID] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CreateDate] [datetime] NOT NULL CONSTRAINT [DF_SHAgentCustomProperties_CreateDate] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SHAgentCustomProperties] ADD CONSTRAINT [PK_SHAgentCustomProperties] PRIMARY KEY CLUSTERED ([AgentCustomPropertyID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SHAgentCustomProperties] ADD CONSTRAINT [FK_SHAgentCustomProperties_AgentID_ShAgents] FOREIGN KEY ([AgentID]) REFERENCES [dbo].[ShAgents] ([AgentID])
GO
ALTER TABLE [dbo].[SHAgentCustomProperties] ADD CONSTRAINT [FK_SHAgentCustomProperties_ShAttributeID_ShAttributes] FOREIGN KEY ([ShAttributeID]) REFERENCES [dbo].[ShAttributes] ([ShAttributeID])
GO