/****** Object:  Table [dbo].[emp_ls5]    Script Date: 13/05/2022 10:43:05 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO



CREATE TABLE [dbo].[emp_ls5](
	[site_cd] [varchar](4) NOT NULL,
	[mst_RowID] [numeric](12, 0) NULL,
	[emp_ls5_module] [varchar](8) NULL,
	[emp_ls5_work_group] [varchar](15) NULL,
	[emp_ls5_varchar1] [varchar](100) NULL,
	[emp_ls5_varchar2] [varchar](100) NULL,
	[emp_ls5_varchar3] [varchar](100) NULL,
	[emp_ls5_varchar4] [varchar](100) NULL,
	[emp_ls5_varchar5] [varchar](100) NULL,
	[emp_ls5_numeric1] [numeric](21, 4) NULL,
	[emp_ls5_numeric2] [numeric](21, 4) NULL,
	[emp_ls5_numeric3] [numeric](21, 4) NULL,
	[emp_ls5_numeric4] [numeric](21, 4) NULL,
	[emp_ls5_numeric5] [numeric](21, 4) NULL,
	[emp_ls5_datetime1] [datetime] NULL,
	[emp_ls5_datetime2] [datetime] NULL,
	[emp_ls5_datetime3] [datetime] NULL,
	[emp_ls5_datetime4] [datetime] NULL,
	[emp_ls5_datetime5] [datetime] NULL,
	[audit_user] [varchar](16) NOT NULL,
	[audit_date] [datetime] NOT NULL,
	[column1] [varchar](60) NULL,
	[column2] [varchar](60) NULL,
	[column3] [varchar](60) NULL,
	[column4] [varchar](60) NULL,
	[column5] [varchar](60) NULL,
	[RowID] [numeric](12, 0) IDENTITY(1,1) NOT NULL
) ON [PRIMARY]
GO


GRANT SELECT, INSERT, UPDATE, DELETE
ON emp_ls5
TO cmms_user
GO

DELETE cf_table WHERE table_name in( 'emp_ls5')
GO

INSERT cf_table (	table_name,           
					table_desc,                                                                                                                                                                                                                                                      
					custom_report, 
					audit_user,       
					audit_date )
VALUES (			'emp_ls5',
					'Employee Maintenance Work Group',
					'0',
					'admin',
					GETDATE())
GO

DELETE	cf_label
WHERE	table_name = 'emp_ls5'
AND 	column_name = 'emp_ls5_module'
GO

INSERT 	cf_label (language_cd, table_name, column_name, 
		default_label,
		customize_label, 
		default_header, 
		customize_header, 
		cfr_flag, cf_label_required, audit_user, audit_date ) 
SELECT 	language_cd, 'emp_ls5', 'emp_ls5_module', 
		'Module:', 
		'Module:', 
		'Module', 
		'Module', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO


DELETE	cf_label
WHERE	table_name = 'emp_ls5'
AND 	column_name = 'emp_ls5_work_group'
GO

INSERT 	cf_label (language_cd, table_name, column_name, 
		default_label,
		customize_label, 
		default_header, 
		customize_header, 
		cfr_flag, cf_label_required, audit_user, audit_date ) 
SELECT 	language_cd, 'emp_ls5', 'emp_ls5_work_group', 
		'Work Group:', 
		'Work Group:', 
		'Work Group', 
		'Work Group', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO
