USE [sggov]
GO

/****** Object:  Table [hrm].[ElementTbl]    Script Date: 06/11/2016 16:01:03 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [hrm].[ElementTbl](
	[Serial] [dbo].[udIDGen] NOT NULL,
	[Name] [dbo].[udIdName] NOT NULL,
	[Title] [dbo].[udMidStr] NOT NULL,
	[Type] [dbo].[udLookup] NOT NULL,
	[CompRef] [dbo].[udIDGen] NULL,
	[Status] [dbo].[udLookup] NULL,
	[Priority] [dbo].[udInteger] NULL,
	[PriorFish] [int] NULL,
	[PriorList] [dbo].[udInteger] NULL,
	[PriorOther] [dbo].[udInteger] NULL,
	[PriorStatute] [dbo].[udInteger] NULL,
	[PriorHrMDent] [dbo].[udInteger] NULL,
	[PriorSubsystemFish] [dbo].[udInteger] NULL,
	[PriorSubsystemList] [dbo].[udInteger] NULL,
	[Descript] [dbo].[udHugeStr] NULL,
	[SLNum] [dbo].[udAccNum] NULL,
	[ShowInFish] [dbo].[udInteger] NULL,
	[ShowInList] [dbo].[udInteger] NULL,
	[ShowInOther] [dbo].[udInteger] NULL,
	[ShowInSubsystemFish] [dbo].[udInteger] NULL,
	[ShowInSubsystemList] [dbo].[udInteger] NULL,
	[IsNetPay] [dbo].[udBoolean] NOT NULL,
 CONSTRAINT [PK_PAY_ELEMENT] PRIMARY KEY CLUSTERED 
(
	[Serial] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [SG_BaseData]
) ON [SG_BaseData]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [hrm].[ElementTbl]  WITH CHECK ADD  CONSTRAINT [FK_Element_PayCompanies] FOREIGN KEY([CompRef])
REFERENCES [hrm].[PayCompanies] ([CompaniesId])
GO

ALTER TABLE [hrm].[ElementTbl] CHECK CONSTRAINT [FK_Element_PayCompanies]
GO

ALTER TABLE [hrm].[ElementTbl]  WITH CHECK ADD  CONSTRAINT [FK_HrmElement_SLNum_DL_AccNum] FOREIGN KEY([SLNum])
REFERENCES [GAC].[GacDetailAccount] ([Code])
GO

ALTER TABLE [hrm].[ElementTbl] CHECK CONSTRAINT [FK_HrmElement_SLNum_DL_AccNum]
GO

