CREATE TABLE [dbo].[clnl_sts](
	[site_cd] [varchar](4) NOT NULL,
	[clnl_sts_cat_cd] [varchar](20) NOT NULL,
	[clnl_sts_typ_cd] [varchar](25) NOT NULL,
	[clnl_sts_status] [varchar](3) NOT NULL,
	[clnl_sts_desc] [varchar](255) NULL,
	[clnl_sts_disable_flag] [varchar](1) NULL,
	[clnl_sts_email_flag] [varchar](1) NULL,
	[audit_user] [varchar](50) 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


DELETE	cf_table
WHERE	table_name = 'clnl_sts'
GO

INSERT	cf_table (	table_name,           
					table_desc,
					custom_report,
					audit_user,
					audit_date )
VALUES (			'clnl_sts',
					'Linen Inventory Checklist New Linen Status Record',
					'0',
					'admin',
					GETDATE())
GO

DELETE	cf_label
WHERE	table_name = 'clnl_sts'
AND 	column_name = 'clnl_sts_cat_cd'
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, 'clnl_sts', 'clnl_sts_cat_cd', 
		'Category:', 
		'Category:', 
		'Category', 
		'Category', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO

DELETE	cf_label
WHERE	table_name = 'clnl_sts'
AND 	column_name = 'clnl_sts_typ_cd'
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, 'clnl_sts', 'clnl_sts_typ_cd', 
		'Type:', 
		'Type:', 
		'Type', 
		'Type', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO

DELETE	cf_label
WHERE	table_name = 'clnl_sts'
AND 	column_name = 'clnl_sts_status'
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, 'clnl_sts', 'clnl_sts_status', 
		'Status:', 
		'Status:', 
		'Status', 
		'Status', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO



DELETE	cf_label
WHERE	table_name = 'clnl_sts'
AND 	column_name = 'clnl_sts_desc'
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, 'clnl_sts', 'clnl_sts_desc', 
		'Description:', 
		'Description:', 
		'Description', 
		'Description', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO


DELETE	cf_label
WHERE	table_name = 'clnl_sts'
AND 	column_name = 'clnl_sts_disable_flag'
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, 'clnl_sts', 'clnl_sts_disable_flag', 
		'Disable?:', 
		'Disable?:', 
		'Disable?', 
		'Disable?', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO


DELETE	cf_label
WHERE	table_name = 'clnl_sts'
AND 	column_name = 'clnl_sts_email_flag'
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, 'clnl_sts', 'clnl_sts_email_flag', 
		'Email:', 
		'Email:', 
		'Email', 
		'Email', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO


Insert into sts_cat (site_cd, sts_cat_cat_cd, sts_cat_desc, audit_user, audit_date)
Select cf_site.site_cd, 'CHECKLIST NEW LINEN ', 'Linen Inventory Checklist New Linen Status', 'admin', getdate() From cf_site
GO

Insert into sts_typ (site_cd, sts_typ_cat_cd, sts_typ_typ_cd, sts_typ_desc, audit_user, audit_date)
Select cf_site.site_cd, 'CHECKLIST NEW LINEN', 'OPEN', 'Open Status', 'admin', getdate() from cf_site
GO

Insert into sts_typ (site_cd, sts_typ_cat_cd, sts_typ_typ_cd, sts_typ_desc, audit_user, audit_date)
Select cf_site.site_cd, 'CHECKLIST NEW LINEN', 'CLOSE', 'Close Status', 'admin', getdate() from cf_site
GO

Insert into sts_typ (site_cd, sts_typ_cat_cd, sts_typ_typ_cd, sts_typ_desc, audit_user, audit_date)
Select cf_site.site_cd, 'CHECKLIST NEW LINEN', 'CANCEL', 'Cancel Status', 'admin', getdate() from cf_site
GO

Insert into clnl_sts (site_cd, clnl_sts_cat_cd, clnl_sts_typ_cd, clnl_sts_status, clnl_sts_disable_flag, clnl_sts_desc, audit_user, audit_date)
Select cf_site.site_cd, 'CHECKLIST NEW LINEN', 'OPEN', 'OPN', '0', 'Open', 'admin',  getdate() from cf_site
GO

Insert into clnl_sts (site_cd, clnl_sts_cat_cd, clnl_sts_typ_cd, clnl_sts_status, clnl_sts_disable_flag, clnl_sts_desc, audit_user, audit_date)
Select cf_site.site_cd, 'CHECKLIST NEW LINEN', 'CLOSE', 'CLO', '0', 'Close', 'admin',  getdate() from cf_site
GO

Insert into clnl_sts (site_cd, clnl_sts_cat_cd, clnl_sts_typ_cd, clnl_sts_status, clnl_sts_disable_flag, clnl_sts_desc, audit_user, audit_date)
Select cf_site.site_cd, 'CHECKLIST NEW LINEN', 'CANCEL', 'CNX', '0', 'Cancel', 'admin',  getdate() from cf_site
GO