CREATE TABLE [dbo].[ShAttributes]
(
[ShAttributeID] [int] NOT NULL IDENTITY(2000, 1),
[AttributeName] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Description] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ShAttributeDataTypeID] [int] NOT NULL,
[SystemDefinitionID] [int] NOT NULL,
[IsActive] [bit] NOT NULL CONSTRAINT [DF_SHAttributes_IsActive] DEFAULT ((1)),
[LookUpCtrlType] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ResponseConstraint] [varchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CustomStoredProcedure] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CreatorID] [varchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[UpdatorID] [varchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CreateDate] [datetime] NOT NULL CONSTRAINT [DF_SHAttributes_CreateDate] DEFAULT (getdate()),
[UpdateDate] [datetime] NOT NULL CONSTRAINT [DF_SHAttributes_UpdateDate] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ShAttributes] ADD CONSTRAINT [PK_SHAttributes] PRIMARY KEY CLUSTERED ([ShAttributeID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ShAttributes] ADD CONSTRAINT [FK_ShAttributes_ShAttributeDataTypeID_ShAttributeDataTypes] FOREIGN KEY ([ShAttributeDataTypeID]) REFERENCES [dbo].[ShAttributeDataTypes] ([ShAttributeDataTypeID])
GO
ALTER TABLE [dbo].[ShAttributes] ADD CONSTRAINT [FK_ShAttributes_SystemDefinitionID_ShAttributesSystemDefinitions] FOREIGN KEY ([SystemDefinitionID]) REFERENCES [dbo].[ShAttributesSystemDefinitions] ([SystemDefinitionID])
GO