/* 2017-04-19 15:33 CREATE SCRIPT */
USE [POSMST]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_TEST_MODE_DTL_INFO]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_TEST_MODE_DTL_INFO](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[TEST_ENTRY_ID] [varchar](5) NOT NULL,
	[DTL_SEQ] [int] NOT NULL,
	[DTL_SEQ_EXPLN] [nvarchar](100) NULL,
	[POS_SCRN_TYPE] [varchar](1) NULL,
	[SCRN_DISP_HOUR] [int] NULL,
	[NUM_PAD_USE_TYPE] [varchar](1) NULL,
	[INPUT_BOX_USE_YN] [varchar](1) NULL,
	[INPUT_BOX_DATA_MIN_LEN] [int] NULL,
	[INPUT_BOX_DATA_MAX_LEN] [int] NULL,
	[INPUT_BOX_CHECK_PREFIX] [varchar](30) NULL,
	[DEVICE_USE_TYPE] [varchar](2) NULL,
	[DEVICE_DATA_MIN_LEN] [int] NULL,
	[DEVICE_DATA_MAX_LEN] [int] NULL,
	[DEVICE_PREFIX_CHECK] [varchar](30) NULL,
	[TOUCH_USE_YN] [varchar](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[USE_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_TEST_MODE_DTL_INFO] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[TEST_ENTRY_ID] ASC,
	[DTL_SEQ] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_TEST_MODE_DTL_LOC]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_TEST_MODE_DTL_LOC](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[TEST_ENTRY_ID] [varchar](5) NOT NULL,
	[DTL_SEQ] [int] NOT NULL,
	[POS_SCRN_TYPE] [varchar](1) NOT NULL,
	[IMG_FILE_NM] [varchar](100) NULL,
	[NUM_PAD_START_LOC_X] [int] NULL,
	[NUM_PAD_START_LOC_Y] [int] NULL,
	[INPUT_BOX_START_LOC_X] [int] NULL,
	[INPUT_BOX_START_LOC_Y] [int] NULL,
	[INPUT_BOX_FNSH_LOC_X] [int] NULL,
	[INPUT_BOX_FNSH_LOC_Y] [int] NULL,
	[TOUCH_START_LOC_X] [int] NULL,
	[TOUCH_START_LOC_Y] [int] NULL,
	[TOUCH_FNSH_LOC_X] [int] NULL,
	[TOUCH_FNSH_LOC_Y] [int] NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[USE_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_TEST_MODE_DTL_LOC] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[TEST_ENTRY_ID] ASC,
	[DTL_SEQ] ASC,
	[POS_SCRN_TYPE] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_TEST_MODE_EXPLN]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_TEST_MODE_EXPLN](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[TEST_ENTRY_ID] [varchar](5) NOT NULL,
	[SEQ] [int] NOT NULL,
	[TEST_ENTRY_EXPLN] [nvarchar](100) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[USE_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_TEST_MODE_EXPLN] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[TEST_ENTRY_ID] ASC,
	[SEQ] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_POS_LOCAL]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_POS_LOCAL](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](50) NOT NULL,
	[GRP_CD] [varchar](5) NOT NULL,
	[ENTRY_CD] [varchar](30) NOT NULL,
	[ENTRY_NM] [nvarchar](200) NULL,
	[DISP_SEQ] [int] NULL,
	[USE_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_POS_LOCAL] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[GRP_CD] ASC,
	[ENTRY_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_HPYCON_ITEM]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_HPYCON_ITEM](
	[CMP_CD] [varchar](4) NOT NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_HPYCON_ITEM] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_MOT_MSG]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_MOT_MSG](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[MSG_TYPE] [char](1) NOT NULL,
	[CNNT_ID] [varchar](20) NOT NULL,
	[SEQ_NO] [int] NOT NULL,
	[MOT_NM] [nvarchar](50) NULL,
	[IMG_NM] [varchar](300) NULL,
	[SOUND_FILE_DIV] [char](2) NULL,
	[SOUND_FILE_NM] [varchar](300) NULL,
	[TTS_DSCRP] [nvarchar](300) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_MOT_MSG] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[MSG_TYPE] ASC,
	[CNNT_ID] ASC,
	[SEQ_NO] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_EMG_NOTE]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_EMG_NOTE](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[POS_NO] [varchar](2) NOT NULL,
	[START_DT] [varchar](8) NOT NULL,
	[MSG_CODE] [varchar](20) NOT NULL,
	[MSG_DIV] [varchar](2) NOT NULL,
	[MSG_TYPE] [varchar](2) NOT NULL,
	[MSG_TITLE] [nvarchar](100) NULL,
	[MSG_CONTENTS] [nvarchar](500) NULL,
	[POS_EXEC_TYPE] [char](1) NULL,
	[POPUP_YN] [char](1) NULL,
	[FNSH_HOUR] [varchar](14) NULL,
	[READ_YN] [varchar](1) NULL,
	[DOWN_YN] [varchar](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
	[SEND_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_EMG_NOTE] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[POS_NO] ASC,
	[START_DT] ASC,
	[MSG_CODE] ASC,
	[MSG_DIV] ASC,
	[MSG_TYPE] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_SUBPRC_MENU]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_SUBPRC_MENU](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[SUB_STOR_CD] [varchar](10) NOT NULL,
	[M_CLSS] [varchar](20) NOT NULL,
	[SEQ_NO] [int] NOT NULL,
	[SUBPRC_MENU_GRP_CD] [varchar](4) NULL,
	[SUBPRC_MENU_GRP_NM] [nvarchar](50) NULL,
	[SEL_TYPE] [char](1) NULL,
	[USE_YN] [char](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_SUBPRC_MENU] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[SUB_STOR_CD] ASC,
	[M_CLSS] ASC,
	[SEQ_NO] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_BILL_MSG]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_BILL_MSG](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[PRT_LOC] [char](1) NOT NULL,
	[WRITE_DIV] [char](1) NOT NULL,
	[SEQ] [int] NOT NULL,
	[PRT_SEQ] [char](2) NULL,
	[PRT_DIV] [char](1) NULL,
	[PRT_START_DT] [char](8) NULL,
	[PRT_FNSH_DT] [char](8) NULL,
	[PRT_START_HOUR] [char](6) NULL,
	[PRT_FNSH_HOUR] [char](6) NULL,
	[EXPAND_CHAR] [char](1) NULL,
	[BOLD_YN] [char](1) NULL,
	[ALIGN_TYPE] [char](1) NULL,
	[CHAR_ROW] [nvarchar](50) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_BILL_MSG] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[PRT_LOC] ASC,
	[WRITE_DIV] ASC,
	[SEQ] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_FUNC_KEY_GRP]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_FUNC_KEY_GRP](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[FUNC_GRP_ID] [char](5) NOT NULL,
	[FUNC_ID] [char](5) NOT NULL,
	[DISP_SEQ] [int] NULL,
	[FUNC_BTN_SIZE] [int] NULL,
	[FONT_SIZE] [int] NULL,
	[FUNC_BTN_COLOR] [varchar](9) NULL,
	[FUNC_NM] [nvarchar](90) NOT NULL,
	[USE_YN] [char](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_FUNC_KEY_GRP] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[FUNC_GRP_ID] ASC,
	[FUNC_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_BILL_TYPE]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_BILL_TYPE](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[BILL_TYPE_GRP_CD] [varchar](4) NOT NULL,
	[BILL_TYPE_DIV] [varchar](2) NOT NULL,
	[SEQ_NO] [int] NOT NULL,
	[SORT_DIV] [char](1) NULL,
	[SIZE_DIV] [char](1) NULL,
	[BOLD_YN] [char](1) NULL,
	[BILL_TYPE_TAG] [nvarchar](1000) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_BILL_TYPE] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[BILL_TYPE_GRP_CD] ASC,
	[BILL_TYPE_DIV] ASC,
	[SEQ_NO] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_CUST_DSP]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_CUST_DSP](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[DISP_KIND] [char](1) NOT NULL,
	[DISP_DIV] [char](1) NOT NULL,
	[SEQ] [int] NOT NULL,
	[FILE_TYPE] [char](1) NULL,
	[START_DT] [varchar](8) NULL,
	[FNSH_DT] [varchar](8) NULL,
	[FILE_TIME] [int] NULL,
	[FILE_NM] [varchar](100) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[USE_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[START_HOUR] [varchar](6) NULL,
	[FNSH_HOUR] [varchar](6) NULL,
	[DOW] [varchar](7) NULL,
 CONSTRAINT [PK_MST_CUST_DSP] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[DISP_KIND] ASC,
	[DISP_DIV] ASC,
	[SEQ] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_TEST_MODE]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_TEST_MODE](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[TEST_ENTRY_ID] [varchar](5) NOT NULL,
	[SEQ] [int] NULL,
	[TEST_ENTRY_NM] [nvarchar](100) NULL,
	[ERR_PRMT_CNT] [int] NULL,
	[TEST_LMT_TIME] [int] NULL,
	[TEST_ENTRY_EXPLN1] [nvarchar](100) NULL,
	[TEST_ENTRY_EXPLN2] [nvarchar](100) NULL,
	[TEST_ENTRY_EXPLN3] [nvarchar](100) NULL,
	[TEST_ENTRY_EXPLN4] [nvarchar](100) NULL,
	[TEST_ENTRY_EXPLN5] [nvarchar](100) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[USE_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_TEST_MODE] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[TEST_ENTRY_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_FLOOR]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_FLOOR](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[FLOOR_CD] [varchar](3) NOT NULL,
	[FLOOR_NM] [nvarchar](50) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_FLOOR] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[FLOOR_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_DC_DTL]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_DC_DTL](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[BRAND_CD] [varchar](4) NOT NULL,
	[PAY_DC_GRP_TYPE] [varchar](2) NOT NULL,
	[PAY_DC_CD] [varchar](2) NOT NULL,
	[CPN_DC_CD] [varchar](2) NOT NULL,
	[CPN_DC_NM] [nvarchar](100) NULL,
	[DC_DIV] [varchar](1) NULL,
	[DC_RATE] [numeric](15, 2) NULL,
	[USE_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_DC_DTL] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[BRAND_CD] ASC,
	[PAY_DC_GRP_TYPE] ASC,
	[PAY_DC_CD] ASC,
	[CPN_DC_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_MEAL_TCKT]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_MEAL_TCKT](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[MEAL_TCKT_ID] [varchar](6) NOT NULL,
	[MEAL_TCKT_NM] [nvarchar](50) NULL,
	[MEAL_TCKT_FACE_AMT] [numeric](15, 2) NULL,
	[BLNC_AMT_EXCHNG_CPN_ISSUE_YN] [char](1) NULL,
	[CHANGE_PAYMNT_YN] [char](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_MEAL_TCKT] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[MEAL_TCKT_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_FLAVOUR]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_FLAVOUR](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[SUB_STOR_CD] [varchar](10) NOT NULL,
	[ITEM_CD] [varchar](30) NOT NULL,
	[BTN_COLOR1] [varchar](9) NULL,
	[BTN_COLOR2] [varchar](9) NULL,
	[FONT_COLOR] [varchar](9) NULL,
	[FONT_SIZE] [int] NULL,
	[IMG_USE_YN] [char](1) NULL,
	[IMG_PATH] [nvarchar](100) NULL,
	[ITEM_LOC] [int] NULL,
	[USE_YN] [char](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_FLAVOUR] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[SUB_STOR_CD] ASC,
	[ITEM_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_CPI_PRT_MSG]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_CPI_PRT_MSG](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[CPI_CD] [varchar](14) NOT NULL,
	[CPI_BILL_PRT_AREA_TYPE] [varchar](1) NOT NULL,
	[PRT_SEQ] [numeric](5, 0) NOT NULL,
	[PRT_EXPAND_TYPE] [char](1) NULL,
	[BOLD_YN] [char](1) NULL,
	[ALIGN_TYPE] [char](1) NULL,
	[MSG_VAL] [nvarchar](50) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[PRT_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_CPI_PRT_MSG] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[CPI_CD] ASC,
	[CPI_BILL_PRT_AREA_TYPE] ASC,
	[PRT_SEQ] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_CPI_COMPNT]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_CPI_COMPNT](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[CPI_CD] [varchar](14) NOT NULL,
	[CPI_ITEM_GRP_CD] [varchar](2) NOT NULL,
	[CPI_COND_TYPE] [varchar](1) NULL,
	[QTY_AMT] [numeric](15, 2) NULL,
	[CPI_DC_TYPE] [char](1) NULL,
	[DC_RATE_QTY_AMT] [numeric](15, 2) NULL,
	[DC_MAX_AMT] [numeric](15, 2) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[USE_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_CPI_COMPNT] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[CPI_CD] ASC,
	[CPI_ITEM_GRP_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_CPI_LTTR_PRT]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_CPI_LTTR_PRT](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[CPI_CD] [varchar](14) NOT NULL,
	[GRADE] [numeric](5, 0) NOT NULL,
	[PRT_SEQ] [numeric](5, 0) NOT NULL,
	[MSG_VAL] [nvarchar](100) NULL,
	[PRT_EXPAND_TYPE] [char](1) NULL,
	[BOLD_YN] [char](1) NULL,
	[ALIGN_TYPE] [char](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[PRT_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_CPI_LTTR_PRT] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[CPI_CD] ASC,
	[GRADE] ASC,
	[PRT_SEQ] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_PGM_VER]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_PGM_VER](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[POS_NO] [varchar](2) NOT NULL,
	[KIND] [varchar](2) NOT NULL,
	[FILE_SEQ] [numeric](5, 0) NOT NULL,
	[FILE_VER] [varchar](30) NOT NULL,
	[FILE_NM] [varchar](40) NULL,
	[APPLY_DATE] [varchar](8) NOT NULL,
	[APP_TYPE] [varchar](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_PGM_VER_1] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[POS_NO] ASC,
	[KIND] ASC,
	[FILE_SEQ] ASC,
	[FILE_VER] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_ITEM_KEY_COMPNT]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_ITEM_KEY_COMPNT](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[POS_SCRN_TYPE] [varchar](1) NOT NULL,
	[FUNC_SCROLL_USE_YN] [varchar](1) NOT NULL,
	[THEME_COLOR] [varchar](9) NULL,
	[LOGIN_IMG] [varchar](200) NULL,
	[BRAND_CI_IMG] [varchar](200) NULL,
	[MAIN_IMG] [varchar](200) NULL,
	[WAIT_IMG] [varchar](200) NULL,
	[BOOKMK_USE_YN] [varchar](1) NULL,
	[BOOKMK_ITEM_KEY_ARRAY] [varchar](2) NULL,
	[HQ_ITEMKEY_LAYOUT] [varchar](2) NULL,
	[SHOP_ITEMKEY_LAYOUT] [varchar](2) NULL,
	[L_CLSS_KEY_BASIC_COLOR] [varchar](9) NULL,
	[L_CLSS_KEY_BASIC_FONT_COLOR] [varchar](9) NULL,
	[L_CLSS_KEY_SEL_COLOR] [varchar](9) NULL,
	[L_CLSS_KEY_SEL_FONT_COLOR] [varchar](9) NULL,
	[ITEM_KEY_BASIC_COLOR] [varchar](9) NULL,
	[ITEM_KEY_BASIC_FONT_COLOR] [varchar](9) NULL,
	[ITEM_KEY_SEL_COLOR] [varchar](9) NULL,
	[ITEM_KEY_SEL_FONT_COLOR] [varchar](9) NULL,
	[FIX_ITEM_CLSS_CNT] [int] NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
	[SUB_STOR_CD] [varchar](10) NOT NULL,
 CONSTRAINT [PK_MST_ITEM_KEY_COMPNT] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[SUB_STOR_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_CPI_HOUR]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_CPI_HOUR](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[CPI_CD] [varchar](14) NOT NULL,
	[DOW_DIV] [char](1) NOT NULL,
	[START_HOUR] [char](4) NULL,
	[FNSH_HOUR] [char](4) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_CPI_HOUR] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[CPI_CD] ASC,
	[DOW_DIV] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_VAN]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_VAN](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[APPR_VEND_CD] [varchar](2) NOT NULL,
	[APPR_VEND_NM] [nvarchar](100) NOT NULL,
	[IP] [varchar](100) NULL,
	[PORT] [varchar](6) NULL,
	[CMP_APPR_ID] [varchar](20) NULL,
	[CMP_APPR_PWD] [varchar](20) NULL,
	[HOME_PAGE] [varchar](100) NULL,
	[APPR_ID] [varchar](20) NULL,
	[APPR_PWD] [varchar](50) NOT NULL,
	[USE_YN] [char](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[MSR_PORT] [varchar](6) NULL,
 CONSTRAINT [PK_MST_VAN] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[APPR_VEND_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_CPI_CARD]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_CPI_CARD](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[CPI_CD] [varchar](14) NOT NULL,
	[CARD_PRFX_CD] [varchar](8) NOT NULL,
	[CHECK_VAL] [varchar](4) NULL,
	[LOC] [numeric](2, 0) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_CPI_CARD] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[CPI_CD] ASC,
	[CARD_PRFX_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_ITEM_KEY_CLSS]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_ITEM_KEY_CLSS](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[SUB_STOR_CD] [varchar](10) NOT NULL,
	[L_CLSS_CD] [varchar](11) NOT NULL,
	[FIX_YN] [char](1) NOT NULL,
	[GRP_SEQ] [int] NOT NULL,
	[ITEM_GRP_NM] [nvarchar](60) NULL,
	[FONT_SIZE] [varchar](9) NULL,
	[BACKGR_COLOR] [varchar](9) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_ITEM_KEY_CLSS] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[SUB_STOR_CD] ASC,
	[L_CLSS_CD] ASC,
	[FIX_YN] ASC,
	[GRP_SEQ] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_ORD]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_ORD](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[TRAIN_MODE_YN] [char](1) NOT NULL,
	[ORD_DIV] [varchar](1) NOT NULL,
	[FLOOR_CD] [varchar](4) NOT NULL,
	[TBL_NO] [varchar](4) NOT NULL,
	[SEQ] [numeric](3, 0) NOT NULL,
	[SUB_STOR_CD] [varchar](10) NULL,
	[ITEM_CD] [varchar](20) NULL,
	[ITEM_DIV] [varchar](1) NULL,
	[SHTCUT_ITEMNM] [nvarchar](50) NULL,
	[SALE_QTY] [numeric](5, 0) NULL,
	[SALE_PRC] [numeric](15, 2) NULL,
	[SALE_AMT] [numeric](15, 2) NULL,
	[BILL_AMT] [numeric](15, 2) NULL,
	[DC_DIV] [varchar](4) NULL,
	[DC_RATE] [numeric](6, 2) NULL,
	[ITEM_DC_AMT] [numeric](15, 2) NULL,
	[SUM_DC_AMT] [numeric](15, 2) NULL,
	[CPI_DC_AMT] [numeric](15, 2) NULL,
	[COOP_CARD_DC_DIV] [varchar](4) NULL,
	[COOP_CARD_DC_AMT] [numeric](15, 2) NULL,
	[POINT_DC_DIV] [varchar](4) NULL,
	[POINT_DC_AMT] [numeric](15, 2) NULL,
	[CPN_DC_DIV] [varchar](4) NULL,
	[CPN_DC_AMT] [numeric](15, 2) NULL,
	[EMP_DC_DIV] [varchar](4) NULL,
	[EMP_DC_AMT] [numeric](15, 2) NULL,
	[SET_DC_AMT] [numeric](15, 2) NULL,
	[ETC_DC_DIV] [varchar](4) NULL,
	[ETC_DC] [numeric](15, 2) NULL,
	[EXCEP_DC_DIV] [varchar](4) NULL,
	[EXCEP_DC_AMT] [numeric](15, 2) NULL,
	[PACK_DIV] [varchar](1) NULL,
	[SET_MENU_CD] [varchar](20) NULL,
	[CPI_PRESENT_DIV] [varchar](1) NULL,
	[SUB_MEMO_DIV] [varchar](1) NULL,
	[MSG1] [nvarchar](50) NULL,
	[MSG2] [nvarchar](50) NULL,
	[MSG3] [nvarchar](50) NULL,
	[MSG_REG_TIME] [varchar](6) NULL,
	[ORD_TIME] [varchar](6) NULL,
	[ORD_COMP_DIV] [varchar](1) NULL,
	[ORD_PIC_NO] [varchar](10) NULL,
	[CANCEL_DIV] [varchar](1) NULL,
	[CANCEL_DATE] [varchar](14) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[NOTAX_DIV] [char](1) NULL,
	[DC_TYPE] [varchar](1) NULL,
	[ORG_QTY] [numeric](5, 0) NULL,
	[ORD_POS_NO] [varchar](5) NULL,
 CONSTRAINT [PK_MST_ORD] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[TRAIN_MODE_YN] ASC,
	[ORD_DIV] ASC,
	[FLOOR_CD] ASC,
	[TBL_NO] ASC,
	[SEQ] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_KPS_ORD_MSG]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_KPS_ORD_MSG](
	[TRAIN_MODE_YN] [char](1) NOT NULL,
	[ORD_DIV] [varchar](1) NOT NULL,
	[FLOOR_CD] [varchar](4) NOT NULL,
	[TBL_NO] [varchar](15) NOT NULL,
	[SUB_STOR_CD] [varchar](10) NOT NULL,
	[KTCH_SYS_CD] [varchar](4) NOT NULL,
	[SEQ] [numeric](3, 0) NOT NULL,
	[ORDER_NO] [varchar](15) NULL,
	[POS_TYPE] [char](1) NULL,
	[ITEM_CD] [varchar](20) NULL,
	[ITEM_DIV] [varchar](1) NULL,
	[SHTCUT_ITEMNM] [nvarchar](50) NULL,
	[SALE_QTY] [numeric](5, 0) NULL,
	[PACK_DIV] [varchar](1) NULL,
	[SET_MENU_CD] [varchar](20) NULL,
	[ORD_TIME] [varchar](6) NULL,
	[CANCEL_DIV] [varchar](1) NULL,
	[SEND_YN] [varchar](1) NULL,
	[RESEND_YN] [varchar](1) NULL,
	[KTCH_SYS_USE_DIV] [varchar](1) NULL,
	[KTCH_PRINTER_COMM_PORT] [int] NULL,
	[KTCH_PRINTER_COMM_SPEED] [int] NULL,
	[KTCH_PRINTER_OPOS_NM] [varchar](50) NULL,
	[KTCH_PRINTER_IP] [varchar](20) NULL,
	[KTCH_PRINTER_PORT] [int] NULL,
	[ERROR_CD] [varchar](4) NULL,
	[KTCH_PRINTER_BAK1] [varchar](4) NULL,
	[KTCH_PRINTER_BAK2] [varchar](4) NULL,
	[KTCH_PRINTER_BAK3] [varchar](4) NULL,
	[KTCH_PRINTER_BAK4] [varchar](4) NULL,
	[KTCH_PRINTER_BAK5] [varchar](4) NULL,
	[KTCH_PRINTER_BAK6] [varchar](4) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[MSG] [nvarchar](200) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[KTCH_MSG] [nvarchar](200) NULL,
	[ORD_PIC_NM] [nvarchar](30) NULL,
	[ORD_POS_NO] [nvarchar](5) NULL,
        --#20180515 KPS 출력시 라벨프린터 출력 start
        [LBLSEND_YN] [varchar](1) NULL,
        --#20180515 KPS 출력시 라벨프린터 출력 end
 CONSTRAINT [PK_MST_KPS_ORD_MSG] PRIMARY KEY CLUSTERED
(
	[TRAIN_MODE_YN] ASC,
	[ORD_DIV] ASC,
	[FLOOR_CD] ASC,
	[TBL_NO] ASC,
	[SUB_STOR_CD] ASC,
	[KTCH_SYS_CD] ASC,
	[SEQ] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_ITEM_KEY]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_ITEM_KEY](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[SUB_STOR_CD] [varchar](10) NOT NULL,
	[L_CLSS_CD] [varchar](11) NOT NULL,
	[FIX_YN] [char](1) NOT NULL,
	[GRP_SEQ] [int] NOT NULL,
	[SEQ] [int] NOT NULL,
	[ITEM_CD] [varchar](20) NULL,
	[SHTCUT_ITEM_NM] [nvarchar](50) NULL,
	[FONT_SIZE] [varchar](9) NULL,
	[BACKGR_COLOR] [varchar](9) NULL,
	[BTN_SIZE] [varchar](2) NULL,
	[SUBPRC_MENU_POPUP_YN] [varchar](1) NULL,
	[FONT_COLOR] [varchar](9) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_ITEM_KEY] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[SUB_STOR_CD] ASC,
	[L_CLSS_CD] ASC,
	[FIX_YN] ASC,
	[GRP_SEQ] ASC,
	[SEQ] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_ORD_SEQ]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_ORD_SEQ](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[SUB_STOR_CD] [varchar](10) NOT NULL,
	[SALE_DATE] [varchar](8) NOT NULL,
	[TRAIN_MODE_YN] [char](1) NOT NULL,
	[ORDER_NO] [int] NOT NULL,
	[REG_DT] [varchar](14) NULL,
	[UPD_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_ORD_SEQ] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[SUB_STOR_CD] ASC,
	[SALE_DATE] ASC,
	[TRAIN_MODE_YN] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_KTCH_ORD_MSG_ADD]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_KTCH_ORD_MSG_ADD](
	[TRAIN_MODE_YN] [char](1) NOT NULL,
	[ORD_DIV] [varchar](1) NOT NULL,
	[FLOOR_CD] [varchar](4) NOT NULL,
	[TBL_NO] [varchar](5) NOT NULL,
	[SEQ] [numeric](3, 0) NOT NULL,
	[SUB_STOR_CD] [varchar](10) NULL,
	[KTCH_SYS_CD] [varchar](4) NULL,
	[ITEM_CD] [varchar](20) NULL,
	[SHTCUT_ITEMNM] [nvarchar](50) NULL,
	[MSG_DIV] [varchar](1) NULL,
	[MSG1] [nvarchar](50) NULL,
	[MSG2] [nvarchar](50) NULL,
	[MSG3] [nvarchar](50) NULL,
	[MSG_REG_TIME] [varchar](6) NULL,
	[SEND_YN] [varchar](1) NULL,
	[SEND_CONFIRM_DIV] [varchar](1) NULL,
	[RESEND_YN] [varchar](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[ORD_POS_NO] [varchar](5) NULL,
 CONSTRAINT [PK_MST_KTCH_ORD_MSG_ADD] PRIMARY KEY CLUSTERED
(
	[TRAIN_MODE_YN] ASC,
	[ORD_DIV] ASC,
	[FLOOR_CD] ASC,
	[TBL_NO] ASC,
	[SEQ] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_KTCH_ORD_MSG]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_KTCH_ORD_MSG](
	[TRAIN_MODE_YN] [char](1) NOT NULL,
	[ORD_DIV] [varchar](1) NOT NULL,
	[FLOOR_CD] [varchar](4) NOT NULL,
	[TBL_NO] [varchar](15) NOT NULL,
	[SEQ] [numeric](3, 0) NOT NULL,
	[CMP_CD] [varchar](4) NULL,
	[BRAND_CD] [varchar](4) NULL,
	[STOR_CD] [varchar](10) NULL,
	[SUB_STOR_CD] [varchar](10) NULL,
	[POS_NO] [varchar](2) NULL,
	[TRADE_NO] [varchar](15) NULL,
	[SALE_DT] [varchar](8) NULL,
	[POS_TYPE] [char](1) NULL,
	[ITEM_CD] [varchar](20) NULL,
	[ITEM_DIV] [varchar](1) NULL,
	[SHTCUT_ITEMNM] [nvarchar](50) NULL,
	[SALE_QTY] [numeric](5, 0) NULL,
	[PACK_DIV] [varchar](1) NULL,
	[SET_MENU_CD] [varchar](20) NULL,
	[ORD_TIME] [varchar](6) NULL,
	[CANCEL_DIV] [varchar](1) NULL,
	[SUB_MEMO_DIV] [varchar](1) NULL,
	[MSG1] [nvarchar](50) NULL,
	[MSG2] [nvarchar](50) NULL,
	[MSG3] [nvarchar](50) NULL,
	[MSG_REG_TIME] [varchar](6) NULL,
	[ORG_BILL_POSNO] [varchar](2) NULL,
	[ORG_BILLDT] [varchar](8) NULL,
	[ORG_BILL_NO] [varchar](5) NULL,
	[SEND_YN] [varchar](1) NULL,
	[SEND_CONFIRM_DIV] [varchar](1) NULL,
	[RESEND_YN] [varchar](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[KTCH_MSG] [nvarchar](200) NULL,
	[ORD_PIC_NM] [nvarchar](30) NULL,
	[ORG_QTY] [numeric](5, 0) NULL,
	[ORD_POS_NO] [varchar](5) NULL,
	[KDS_SEND_YN] [varchar](1) NULL,
 CONSTRAINT [PK_MST_KTCH_ORD_MSG] PRIMARY KEY CLUSTERED
(
	[TRAIN_MODE_YN] ASC,
	[ORD_DIV] ASC,
	[FLOOR_CD] ASC,
	[TBL_NO] ASC,
	[SEQ] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_BOOKMK]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_BOOKMK](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[SUB_STOR_CD] [varchar](10) NOT NULL,
	[ITEM_CD] [varchar](18) NOT NULL,
	[SEQ] [int] NOT NULL,
	[SHTCUT_ITEM_NM] [nvarchar](20) NULL,
	[ITEM_PRC] [numeric](15, 2) NULL,
	[FONT_SIZE] [varchar](9) NULL,
	[BACKGR_COLOR] [varchar](9) NULL,
	[BTN_SIZE] [varchar](2) NULL,
	[SUBPRC_MENU_POPUP_YN] [varchar](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_BOOKMK] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[SUB_STOR_CD] ASC,
	[ITEM_CD] ASC,
	[SEQ] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_SEAT_MEMO]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_SEAT_MEMO](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[TRAIN_MODE_YN] [char](1) NOT NULL,
	[ORD_DIV] [varchar](1) NOT NULL,
	[FLOOR_CD] [varchar](4) NOT NULL,
	[TBL_NO] [varchar](4) NOT NULL,
	[SEQ] [numeric](3, 0) NOT NULL,
	[MSG1] [nvarchar](50) NULL,
	[MSG2] [nvarchar](50) NULL,
	[MSG3] [nvarchar](50) NULL,
	[CASHIER_ID] [varchar](10) NULL,
	[REG_TIME] [varchar](9) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_SEAT_MEMO] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[TRAIN_MODE_YN] ASC,
	[ORD_DIV] ASC,
	[FLOOR_CD] ASC,
	[TBL_NO] ASC,
	[SEQ] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_BILL_TYPE_GRP]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_BILL_TYPE_GRP](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[BILL_TYPE_GRP_CD] [varchar](4) NOT NULL,
	[BILL_TYPE_GRP_NM] [nvarchar](50) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_BILL_TYPE_GRP] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[BILL_TYPE_GRP_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_PRECARD]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_PRECARD](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[PRECARD_ID] [varchar](2) NOT NULL,
	[PRECARD_SHORT_NM] [nvarchar](60) NULL,
	[PRECARD_NM] [nvarchar](60) NULL,
	[PRECARD_AMT] [numeric](15, 2) NULL,
	[SORT_QUE] [numeric](5, 0) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_PRECARD] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[PRECARD_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_TBL]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_TBL](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[TRAIN_MODE_YN] [char](1) NOT NULL,
	[FLOOR_CD] [varchar](3) NOT NULL,
	[TBL_NO] [varchar](3) NOT NULL,
	[TBL_NM] [nvarchar](50) NULL,
	[TBL_TYPE] [char](1) NULL,
	[TBL_TYPE_SHAPE] [char](1) NULL,
	[BACKGRCOLOR] [varchar](9) NULL,
	[BACKGR_IMG] [varchar](100) NULL,
	[FONTCOLOR] [varchar](9) NULL,
	[FONT_NM] [nvarchar](20) NULL,
	[FONT_SIZE] [int] NULL,
	[X_COORD] [int] NULL,
	[Y_COORD] [int] NULL,
	[WIDTH] [int] NULL,
	[HGT] [int] NULL,
	[TBL_DISP_DIV] [char](1) NULL,
	[SEAT_CNT] [int] NULL,
	[SEAT_CNT_DISP_DIV] [char](1) NULL,
	[TBL_OP_DIV] [char](1) NULL,
	[OP_FLOOR_CD] [varchar](3) NULL,
	[OP_TBL_NO] [varchar](3) NULL,
	[TBL_USE_DIV] [varchar](1) NULL,
	[CUST_CNT] [int] NULL,
	[FIRST_ORD_HOUR] [varchar](14) NULL,
	[ORD_AMT] [numeric](15, 2) NULL,
	[RESERV_DIV] [char](1) NULL,
	[RESERV_HOUR] [varchar](14) NULL,
	[ORD_COLOR] [varchar](9) NULL,
	[PAY_CMPT_COLOR] [varchar](9) NULL,
	[PAY_CMPT_DIV] [char](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_TBL] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[TRAIN_MODE_YN] ASC,
	[FLOOR_CD] ASC,
	[TBL_NO] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_ADMT_TYPE_GRP]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_ADMT_TYPE_GRP](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[ADMT_TYPE_GRP_CD] [varchar](4) NOT NULL,
	[ADMT_TYPE_GRP_CD_NM] [nvarchar](50) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](15) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_ADMT_TYPE_GRP] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[ADMT_TYPE_GRP_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_ITEM_KEY_L_CLSS]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_ITEM_KEY_L_CLSS](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[SUB_SHOP_CD] [varchar](10) NOT NULL,
	[SEQ] [int] NOT NULL,
	[L_CLSS_CD] [varchar](11) NOT NULL,
	[L_CLSS_NM] [nvarchar](60) NULL,
	[HQ_KEY_DIV] [varchar](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_ITEM_KEY_L_CLSS] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[SUB_SHOP_CD] ASC,
	[SEQ] ASC,
	[L_CLSS_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_OUT_SD_VEND_STOR]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_OUT_SD_VEND_STOR](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[POS_NO] [varchar](2) NOT NULL,
	[JOIN_CMP_CD] [varchar](5) NULL,
	[JOIN_BRAND_CD] [varchar](10) NULL,
	[JOIN_STOR_CD] [varchar](10) NULL,
	[JOIN_ITEM_CD] [varchar](10) NULL,
	[USE_YN] [varchar](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_OUT_SD_VEND_STOR] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[POS_NO] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_ADMT_TYPE]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_ADMT_TYPE](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[ADMT_TYPE_GRP_CD] [varchar](4) NOT NULL,
	[ADMT_TYPE] [char](1) NOT NULL,
	[SEQ_NO] [int] NOT NULL,
	[ADMT_CD] [varchar](4) NULL,
	[PRT_DIV] [char](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_ADMT_TYPE] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[ADMT_TYPE_GRP_CD] ASC,
	[ADMT_TYPE] ASC,
	[SEQ_NO] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_SALESORG_SURVY_MSG]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_SALESORG_SURVY_MSG](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[APPLY_START_DT] [varchar](8) NOT NULL,
	[SEQ_NO] [int] NOT NULL,
	[PRT_SEQ] [int] NULL,
	[APPLY_FNSH_DT] [varchar](8) NULL,
	[APPLY_START_HOUR] [varchar](6) NULL,
	[MSG_VAL] [nvarchar](50) NULL,
	[DOW] [varchar](7) NULL,
	[BOLD_YN] [char](1) NULL,
	[PRT_EXPAND_TYPE] [char](1) NULL,
	[ALIGN_TYPE] [char](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[USE_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_SALESORG_SURVY_MSG] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[APPLY_START_DT] ASC,
	[SEQ_NO] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_POS]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_POS](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[POS_NO] [varchar](5) NOT NULL,
	[POS_IP] [varchar](50) NULL,
	[POS_TYPE] [char](1) NULL,
	[MAIN_YN] [varchar](4) NULL,
	[BILL_TYPEGRP] [varchar](4) NULL,
	[KTCHPRINTER_TYPE_GRP] [varchar](4) NULL,
	[ADMT_TYPE_GRP] [varchar](50) NULL,
	[CERTF_VER] [varchar](16) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
	[SUB_STOR_CD] [varchar](10) NULL,
 CONSTRAINT [PK_MST_POS] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[POS_NO] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_PAY_DC_PRFX]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_PAY_DC_PRFX](
	[CMP_CD] [varchar](4) NOT NULL,
	[PRFX_INFO] [varchar](100) NOT NULL,
	[PAY_DC_GRP_TYPE] [varchar](2) NULL,
	[PAY_DC_CD] [varchar](2) NULL,
	[USE_YN] [char](1) NULL,
	[REG_DT] [varchar](14) NULL,
	[UPD_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_PAY_DC_PRFX] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[PRFX_INFO] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_PIC_AUTH]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_PIC_AUTH](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[CASHIER_ID] [varchar](10) NOT NULL,
	[FUNC_ID] [char](5) NOT NULL,
	[MNG_AUTH] [char](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_PIC_AUTH] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[CASHIER_ID] ASC,
	[FUNC_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_MOT_MSG_DTL]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_MOT_MSG_DTL](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[MSG_TYPE] [char](1) NOT NULL,
	[CNNT_ID] [varchar](20) NOT NULL,
	[SEQ_NO] [int] NOT NULL,
	[SEQ] [int] NOT NULL,
	[MSG] [nvarchar](300) NULL,
	[FONT_SIZE] [int] NOT NULL,
	[FONT_COLOR] [varchar](50) NULL,
	[NEW_LINE_YN] [char](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_MOT_MSG_DTL] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[MSG_TYPE] ASC,
	[CNNT_ID] ASC,
	[SEQ_NO] ASC,
	[SEQ] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_KDS_ORD_MSG]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_KDS_ORD_MSG](
	[ORD_DIV] [varchar](1) NOT NULL,
	[FLOOR_CD] [varchar](4) NOT NULL,
	[TBL_NO] [varchar](15) NOT NULL,
	[KTCH_SYS_CD] [varchar](4) NOT NULL,
	[SEQ] [numeric](3, 0) NOT NULL,
	[CMP_CD] [varchar](4) NULL,
	[BRAND_CD] [varchar](4) NULL,
	[STOR_CD] [varchar](10) NULL,
	[POS_NO] [varchar](2) NULL,
	[TRADE_NO] [varchar](15) NULL,
	[SALE_DT] [varchar](8) NULL,
	[POS_TYPE] [char](1) NULL,
	[ITEM_CD] [varchar](20) NULL,
	[ITEM_DIV] [varchar](1) NULL,
	[SHTCUT_ITEMNM] [nvarchar](50) NULL,
	[SALE_QTY] [numeric](5, 0) NULL,
	[PACK_DIV] [varchar](1) NULL,
	[SET_MENU_CD] [varchar](20) NULL,
	[ORD_TIME] [varchar](6) NULL,
	[CANCEL_DIV] [varchar](1) NULL,
	[ORG_BILL_POSNO] [varchar](2) NULL,
	[ORG_BILLDT] [varchar](8) NULL,
	[ORG_BILL_NO] [varchar](5) NULL,
	[KTCH_SYS_USE_DIV] [varchar](1) NULL,
	[KTCH_KDS_IP] [varchar](20) NULL,
	[KTCH_KDS_PORT] [int] NULL,
	[ERROR_CD] [varchar](4) NULL,
	[SEND_YN] [varchar](1) NULL,
	[RESEND_YN] [varchar](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[F_CNT] [int] NULL,
 CONSTRAINT [PK_MST_KDS_ORD_MSG] PRIMARY KEY CLUSTERED
(
	[ORD_DIV] ASC,
	[FLOOR_CD] ASC,
	[TBL_NO] ASC,
	[KTCH_SYS_CD] ASC,
	[SEQ] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_RESERV]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_RESERV](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[RESERV_NO] [varchar](10) NOT NULL,
	[RESERV_DT] [varchar](10) NOT NULL,
	[RESERV_TM] [varchar](4) NULL,
	[CASHIER_NM] [nvarchar](20) NULL,
	[TEL_NO] [varchar](16) NULL,
	[NOTE] [nvarchar](4000) NULL,
	[ALARM_YN] [varchar](1) NULL,
	[ALARM_TM] [varchar](1) NULL,
	[CONFIRM] [varchar](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_ID] [varchar](10) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_ID] [varchar](10) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_RESERV] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[RESERV_NO] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_PLU_AMT]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_PLU_AMT](
	[CMP_CD] [nvarchar](4) NOT NULL,
	[STOR_CD] [nvarchar](10) NOT NULL,
	[PLU_SEQ] [numeric](2, 0) NOT NULL,
	[PLU_AMT_NM] [nvarchar](40) NOT NULL,
	[P_POSITION] [numeric](5, 0) NOT NULL,
	[FROM_AMT] [numeric](11, 2) NOT NULL,
	[TO_AMT] [numeric](11, 2) NOT NULL,
	[USE_YN] [char](1) NOT NULL,
	[REG_DT] [varchar](14) NULL,
	[UPD_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_PLU_AMT] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[PLU_SEQ] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_CPI]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_CPI](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[CPI_CD] [varchar](14) NOT NULL,
	[CPI_NM] [nvarchar](100) NULL,
	[STARTDAY] [char](8) NULL,
	[FNSHDAY] [char](8) NULL,
	[REPT_YN] [char](1) NULL,
	[REPT_APPNT_TYPE] [char](1) NULL,
	[REPT_WEEK] [char](5) NULL,
	[REPT_DT] [varchar](2) NULL,
	[DUP_APPLY_YN] [char](1) NULL,
	[BASIC_RULE_EXCEP_YN] [char](1) NULL,
	[TELECOM_COOP_DUP_PRMT_YN] [char](1) NULL,
	[PRRTY] [numeric](6, 0) NULL,
	[TRGT_CUST_TYPE] [char](1) NULL,
	[CPI_CUST_BNFT_TYPE] [char](2) NULL,
	[ITEM_APPLY_METHD] [char](2) NULL,
	[CUST_PAY_TYPE] [char](2) NULL,
	[TRGT_AMT_TYPE] [char](1) NULL,
	[TRGT_AMT] [numeric](15, 2) NULL,
	[QTY_LMT_YN] [char](1) NULL,
	[LMT_QTY] [numeric](6, 0) NULL,
	[QTY_LMT_STD] [char](1) NULL,
	[HP_CUST_JOIN_LMT_YN] [char](1) NULL,
	[HP_CUST_MAX_JOIN_CNT] [numeric](5, 0) NULL,
	[HP_CUST_JOIN_LMT_STD] [char](1) NULL,
	[BASIC_HP_ACCUM_YN] [char](1) NULL,
	[BASIC_HP_ACCUM_STD] [char](1) NULL,
	[ADD_HP_ACCUM_TELECOM_DIV] [char](1) NULL,
	[ADD_HP_ACCUM_TRGT_STD] [char](1) NULL,
	[ADD_HP_ACCUM_RATE] [numeric](6, 3) NULL,
	[ADD_HP_ACCUM_AF_DIV] [varchar](1) NULL,
	[ADD_HP_ACCUM_CD1] [varchar](2) NULL,
	[ADD_HP_ACCUM_CD2] [varchar](2) NULL,
	[OFFER_ID] [varchar](20) NULL,
	[FREE_GIFT_PROVD_STD] [char](1) NULL,
	[FREE_GIFT_STD_AMT] [numeric](15, 2) NULL,
	[FREE_GIFT_PROVD_QTY] [numeric](6, 0) NULL,
	[FREE_GIFT_ADD_SALE_YN] [char](1) NULL,
	[CPI_INFO] [nvarchar](4000) NULL,
	[CPI_EXPLN] [nvarchar](4000) NULL,
	[LTTR_MAX_GRADE] [numeric](5, 0) NULL,
	[CUST_DSP_FILE_DIV] [char](1) NULL,
	[CUST_DSP_FILENM] [varchar](300) NULL,
	[STAMP_QTY] [int] NULL,
	[SOUND_FILE_DIV] [char](2) NULL,
	[SOUND_FILE_NM] [varchar](300) NULL,
	[TTS_DSCRP] [nvarchar](300) NULL,
	[SOUND_FILE_PLAY_CHK_PNT] [char](1) NULL,
	[USE_YN] [char](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[JOIN_QUSTN_YN] [char](1) NULL,
	[PRGRS_STATUS] [char](1) NULL,
	[ITEM_DUP_PRMT_YN] [char](1) NULL,
	[LTTR_MULTI_PRT_YN] [char](1) NULL,
	[CPI_DC_PAY_WAY] [varchar](2) NULL,
	[CPI_BILL_NM] [nvarchar](30) NULL,
	[QTY_LIMIT_MSG] [nvarchar](30) NULL,
	[HP_CUST_LVL] [varchar](5) NULL,
	[DC_NOADM_PASS_YN] [varchar](1) NULL,
        --#15583 캠페인 기능 개선 요청 start
        [MOBILE_CPN_DUP_PRMT_YN] [char](1) NOT NULL DEFAULT '0',
        [HPY_CPN_DUP_PRMT_YN] [char](1) NOT NULL DEFAULT '0',
        --#15583 캠페인 기능 개선 요청 end
 CONSTRAINT [PK_MST_CPI] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[CPI_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_PLU_NM]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_PLU_NM](
	[CMP_CD] [nvarchar](4) NOT NULL,
	[STOR_CD] [nvarchar](10) NOT NULL,
	[KEY_MODE] [char](1) NOT NULL,
	[PLU_SEQ] [numeric](2, 0) NOT NULL,
	[PLU_NM] [nvarchar](40) NOT NULL,
	[P_POSITION] [numeric](5, 0) NULL,
	[PLU_1_FR] [nvarchar](2) NOT NULL,
	[PLU_1_TO] [nvarchar](2) NOT NULL,
	[PLU_2_FR] [nvarchar](2) NULL,
	[PLU_2_TO] [nvarchar](2) NULL,
	[PLU_3_FR] [nvarchar](2) NULL,
	[PLU_3_TO] [nvarchar](2) NULL,
	[USE_YN] [char](1) NOT NULL,
	[REG_DT] [varchar](14) NULL,
	[UPD_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_PLU_NM] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[KEY_MODE] ASC,
	[PLU_SEQ] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_CPI_ITEM]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_CPI_ITEM](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[CPI_CD] [varchar](14) NOT NULL,
	[SUB_STOR_CD] [varchar](10) NOT NULL,
	[CPI_ITEM_GRP_CD] [char](2) NOT NULL,
	[ITEM_LVL] [char](1) NOT NULL,
	[ITEM_CD] [varchar](20) NOT NULL,
	[CPI_DC_TYPE] [char](1) NULL,
	[DC_RATE_AMT] [numeric](15, 2) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_CPI_ITEM] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[CPI_CD] ASC,
	[SUB_STOR_CD] ASC,
	[CPI_ITEM_GRP_CD] ASC,
	[ITEM_LVL] ASC,
	[ITEM_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_ITEM_KEY_CLSS_BATCH]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_ITEM_KEY_CLSS_BATCH](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[L_CLSS_CD] [varchar](11) NOT NULL,
	[ITEM_GRP_CD] [varchar](10) NOT NULL,
	[GRP_KEY_BATCH_YN] [varchar](1) NULL,
	[BATCH_SEQ] [int] NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_ITEM_KEY_CLSS_BATCH] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[L_CLSS_CD] ASC,
	[ITEM_GRP_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_POS_OPTN]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_POS_OPTN](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[POS_NO] [varchar](5) NOT NULL,
	[OPTN_CD] [varchar](10) NOT NULL,
	[OPTN_VAL] [varchar](10) NULL,
	[OPTN_NM] [nvarchar](50) NULL,
	[OPTN_EXPLN] [nvarchar](50) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_POS_OPTN] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[POS_NO] ASC,
	[OPTN_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_PAY_DC]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_PAY_DC](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[PAY_DC_GRP_TYPE] [varchar](2) NOT NULL,
	[PAY_DC_CD] [varchar](2) NOT NULL,
	[PAY_DC_NM] [nvarchar](100) NULL,
	[PAY_DC_TYPE] [char](1) NULL,
	[APPR_VEND_CD] [varchar](2) NULL,
	[CASH_BILL_ISSUE_YN] [char](1) NULL,
	[BLNC_AMT_EXCHNG_CPN_PRT_YN] [char](1) NULL,
	[CNNT_ITEM_CHECK_YN] [char](1) NULL,
	[COOP_CMP_CNNT_YN] [char](1) NULL,
	[PRFX_TRGT_YN] [char](1) NULL,
	[PAY_DC_METHD] [char](1) NULL,
	[PAY_DC_VAL] [numeric](15, 2) NULL,
	[DC_APPLY_TRGT] [char](1) NULL,
	[HP_BASIC_ACCUM_YN] [char](1) NULL,
	[DC_TRGT_AMT_TYPE] [char](1) NULL,
	[CPI_DUP_YN] [char](1) NULL,
	[DC_TELECOM_DUP_YN] [char](1) NULL,
	[DC_POINT_DUP_YN] [char](1) NULL,
	[DC_CPN_DUP_YN] [char](1) NULL,
	[DC_EMP_DC_DUP_YN] [char](1) NULL,
	[DC_GNRL_DUP_YN] [char](1) NULL,
	[PAY_GNRL_DUP_YN] [char](1) NULL,
	[PAY_MOBILE_DUP_YN] [char](1) NULL,
	[PAY_POINT_DUP_YN] [char](1) NULL,
	[SALE_POS_PRT_QUE] [numeric](5, 0) NULL,
	[USE_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[HP_ADD_ACCUM_DIV] [varchar](1) NULL,
	[MOBILE_DC_DIV] [varchar](1) NULL,
 CONSTRAINT [PK_MST_PAY_DC] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[PAY_DC_GRP_TYPE] ASC,
	[PAY_DC_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_COMPLEX_SHOP_STOR]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_COMPLEX_SHOP_STOR](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[COMPLEX_SHOP_BRAND_CD] [varchar](4) NOT NULL,
	[COMPLEX_SHOP_STOR_CD] [varchar](10) NOT NULL,
	[COMPLEX_SHOP_STOR_NM] [nvarchar](50) NULL,
	[DISP_SEQ] [int] NULL,
	[USE_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_COMPLEX_SHOP_STOR] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[COMPLEX_SHOP_BRAND_CD] ASC,
	[COMPLEX_SHOP_STOR_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_HPORD]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_HPORD](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[ORD_DT] [varchar](8) NOT NULL,
	[ORD_NO] [varchar](15) NOT NULL,
	[ORD_STS] [varchar](10) NULL,
	[PRT_YN] [char](1) NULL,
	[NUTRITION_MSG] [nvarchar](4000) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	
	--#17141 [해피오더]배달영수증 주소 추가 start
	--기존
	--[FILLER5] [varchar](50) NULL,
	--변경
	[FILLER5] [varchar](100) NULL,
	--#17141 [해피오더]배달영수증 주소 추가 end

	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_HPORD] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[ORD_DT] ASC,
	[ORD_NO] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_PAY_DC_CPN]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_PAY_DC_CPN](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[MOBILE_CPN_MNG_NO] [varchar](20) NOT NULL,
	[PRODUCT_CD] [varchar](20) NULL,
	[PAY_DC_GRP_TYPE] [varchar](2) NULL,
	[PAY_DC_CD] [varchar](2) NULL,
	[SALE_START_DT] [varchar](8) NULL,
	[SALE_FNSH_DT] [varchar](8) NULL,
	[ITEM_CHECK_YN] [char](1) NULL,
	[PRFX_INFO] [varchar](100) NULL,
	[SHEETCNT_LMT_YN] [char](1) NULL,
	[LMT_QTY] [numeric](6, 0) NULL,
	[VALID_TERM_NOD] [numeric](2, 0) NULL,
	[USE_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_PAY_DC_CPN] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[MOBILE_CPN_MNG_NO] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_WEB_LNKAGE]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_WEB_LNKAGE](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[SEQ_NO] [numeric](2, 0) NOT NULL,
	[DIV] [varchar](1) NULL,
	[DISP_SEQ] [numeric](2, 0) NULL,
	[DISP_YN] [char](1) NULL,
	[MENU_NM] [varchar](30) NULL,
	[WEB_MENU_ID] [varchar](100) NULL,
	[FUNC_ID] [varchar](5) NULL,

	--#15884 해피오더 실시간 추가재고 등록메뉴 및 알람기능 개발 start
	--기존
	--[PARAM] [varchar](100) NULL,
	--변경
	[PARAM] [varchar](200) NULL,
	--#15884 해피오더 실시간 추가재고 등록메뉴 및 알람기능 개발 end


	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_WEB_LNKAGE_] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[SEQ_NO] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_CMM]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_CMM](
	[CMP_CD] [varchar](4) NOT NULL,
	[CMM_GRP_CD] [varchar](5) NOT NULL,
	[CMM_CD] [varchar](30) NOT NULL,
	[LANG_TYPE] [varchar](30) NOT NULL,
	[ENTRY_NM] [nvarchar](100) NULL,
	[DISP_SEQ] [numeric](5, 0) NULL,
	[H_RANK_CMM_GRP_CD] [varchar](5) NULL,
	[H_RANK_CMM_CD] [varchar](30) NULL,
	[SALES_ORG_CD] [varchar](4) NULL,
	[EXPLN] [nvarchar](200) NULL,
	[USE_YN] [char](1) NULL,
	[CHAR_VAL_TITLE_VAL_01] [nvarchar](100) NULL,
	[CHAR_VAL_TITLE_VAL_02] [nvarchar](100) NULL,
	[CHAR_VAL_TITLE_VAL_03] [nvarchar](100) NULL,
	[CHAR_VAL_TITLE_VAL_04] [nvarchar](100) NULL,
	[CHAR_VAL_TITLE_VAL_05] [nvarchar](100) NULL,
	[CHAR_VAL_TITLE_VAL_06] [nvarchar](100) NULL,
	[CHAR_VAL_TITLE_VAL_07] [nvarchar](100) NULL,
	[CHAR_VAL_TITLE_VAL_08] [nvarchar](100) NULL,
	[CHAR_VAL_TITLE_VAL_09] [nvarchar](100) NULL,
	[CHAR_VAL_TITLE_VAL_10] [nvarchar](100) NULL,
	[CHAR_VAL_TITLE_VAL_11] [nvarchar](100) NULL,
	[CHAR_VAL_TITLE_VAL_12] [nvarchar](100) NULL,
	[CHAR_VAL_TITLE_VAL_13] [nvarchar](100) NULL,
	[CHAR_VAL_TITLE_VAL_14] [nvarchar](100) NULL,
	[CHAR_VAL_TITLE_VAL_15] [nvarchar](100) NULL,
	[NUM_VAL_TITLE_VAL_01] [varchar](100) NULL,
	[NUM_VAL_TITLE_VAL_02] [varchar](100) NULL,
	[NUM_VAL_TITLE_VAL_03] [varchar](100) NULL,
	[NUM_VAL_TITLE_VAL_04] [varchar](100) NULL,
	[NUM_VAL_TITLE_VAL_05] [varchar](100) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_CMM] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[CMM_GRP_CD] ASC,
	[CMM_CD] ASC,
	[LANG_TYPE] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_TERM_COOP_CMP_DC_ITEM]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_TERM_COOP_CMP_DC_ITEM](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[PAY_DC_GRP_TYPE] [varchar](2) NOT NULL,
	[PAY_DC_CD] [varchar](2) NOT NULL,

	--#14231 KT 웰컴기프트 카드 기능 개발, PHJ START
	--기존
	--[COOP_CMP_GRADE_CD] [varchar](2) NOT NULL,
	--수정
	[COOP_CMP_GRADE_CD] [varchar](4) NOT NULL,
	--#14231 KT 웰컴기프트 카드 기능 개발, PHJ END

	[START_DT] [varchar](8) NOT NULL,
	[ITEM_CD] [varchar](20) NOT NULL,
	[USE_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_TERM_COOP_CMP_DC_ITEM] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[PAY_DC_GRP_TYPE] ASC,
	[PAY_DC_CD] ASC,
	[COOP_CMP_GRADE_CD] ASC,
	[START_DT] ASC,
	[ITEM_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_ITEM]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_ITEM](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[SUB_STOR_CD] [varchar](10) NOT NULL,
	[ITEM_CD] [varchar](20) NOT NULL,
	[L_CLSS] [varchar](12) NULL,
	[M_CLSS] [varchar](12) NULL,
	[S_CLSS] [varchar](12) NULL,
	[FLAVOUR_DIV] [char](1) NULL,
	[FLAVOUR_QTY] [numeric](15, 2) NULL,
	[FLAVOUR_STOCK] [numeric](15, 2) NULL,
	[SHTCUT_ITEMNM] [nvarchar](50) NULL,
	[ITEM_NM] [nvarchar](50) NULL,
	[TAKE_IN_SALE_AMT] [numeric](15, 2) NULL,
	[TAKE_OUT_SALE_AMT] [numeric](15, 2) NULL,
	[IF_MENU1] [varchar](20) NULL,
	[IF_MENU2] [varchar](20) NULL,
	[OPEN_ITEM_DIV] [char](1) NULL,
	[DISPO_ITEM_DIV] [char](1) NULL,
	[SUB_SET_MNG_TYPE] [char](1) NULL,
	[ITEM_TAX_AMT_DIV] [char](1) NULL,
	[TAKE_IN_VAT_CD] [varchar](5) NULL,
	[TAKE_OUT_VAT_CD] [varchar](5) NULL,
	[ITEM_COST] [numeric](15, 2) NULL,
	[SALE_PRMT_YN] [char](1) NULL,
	[SALE_NOQ] [int] NULL,
	[FREE_GIFT_YN] [char](1) NULL,
	[DC_PRMT_YN] [char](1) NULL,
	[ACCUM_PRMT_YN] [char](1) NULL,
	[SVC_FEE_TRGT_YN] [char](1) NULL,
	[BTN_ITEM_IMG] [varchar](100) NULL,
	[NEW_ITEM_START_DT] [varchar](8) NULL,
	[NEW_ITEM_FNSH_DT] [varchar](8) NULL,
	[ITEM_TYPE] [varchar](2) NULL,
	[TIME_BAR_CD_YN] [char](1) NULL,
	[DISTBT_EXPIRE_NOD] [varchar](6) NULL,
	[ALCOHOL_ITEM_TYPE] [char](1) NULL,
	[SALE_START_DT] [varchar](8) NULL,
	[SALE_FNSH_DT] [varchar](8) NULL,
	[COOP_CARD_DC_NOADM_YN] [char](1) NULL,
	[CAKE_EXCHNG_CPN_USE_POSS_YN] [char](1) NULL,
	[ITEM_INFO] [nvarchar](4000) NULL,
	[CALORY_INFO] [nvarchar](50) NULL,
	[SALE_IMG_FILE_NM] [varchar](100) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[USE_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[RPST_ITEM_CD] [varchar](20) NULL,

	-- #15746 해피오더 '쇼킹박스' 관련 POS 시스템 개발 요청 start
	[PLACE_ORIGIN] [NVARCHAR](4000) NULL, -- 원산지정보
	[ITEM_EXPLN] [NVARCHAR](4000) NULL, -- 상품설명
	[ALLERGY] [NVARCHAR](4000) NULL, -- 알레르기정보
	-- #15746 해피오더 '쇼킹박스' 관련 POS 시스템 개발 요청 end

	-- #15945 해피오더 자동주문 상세기능 start
	[HP_ORD_DIV] [char](1) NULL,
	-- #15945 해피오더 자동주문 상세기능 end

	-- #15945 해피오더 자동주문 상세기능 start
	[ITEM_PROD_TYPE_YN] [Varchar](1) NULL,
	-- #15945 해피오더 자동주문 상세기능 end

	[TAX_AMT_INCLUDE_YN] [varchar](1) NULL,
	[EXE_HPORD] [varchar](1) NULL,

 CONSTRAINT [PK_MST_ITEM] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[SUB_STOR_CD] ASC,
	[ITEM_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_CARD_PREFIX]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_CARD_PREFIX](
	[CMP_CD] [varchar](4) NOT NULL,
	[PRFX_CD] [varchar](8) NOT NULL,
	[CARD_DIV] [varchar](2) NOT NULL,
	[PRFX_NM] [nvarchar](100) NULL,
	[CARD_CMP_CD] [varchar](2) NULL,
	[LOC] [numeric](2, 0) NULL,
	[CHECK_VAL] [varchar](3) NULL,
	[BANK_CD] [varchar](4) NULL,
	[COOP_CARD_DIV] [varchar](2) NULL,
	[USE_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_CARD_PREFIX] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[PRFX_CD] ASC,
	[CARD_DIV] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_POS_SETTNG]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_POS_SETTNG](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[POS_NO] [varchar](5) NOT NULL,
	[SETTNG_ENTRY_CLSS_DIV] [varchar](2) NOT NULL,
	[SETTNG_ENTRY_CD] [varchar](10) NOT NULL,
	[SETTNG_ENTRY_VAL] [nvarchar](100) NULL,
	[SETTNG_ENTRY_NM] [nvarchar](80) NULL,
	[SETTNG_INPUT_DIV] [char](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_POS_SETTNG] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[POS_NO] ASC,
	[SETTNG_ENTRY_CLSS_DIV] ASC,
	[SETTNG_ENTRY_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_DPST_WTHDR_ACC]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_DPST_WTHDR_ACC](
	[CMP_CD] [varchar](4) NOT NULL,
	[DRT_FRCS_DIV] [varchar](2) NOT NULL,
	[DPST_WTHDR_ACC_CD] [varchar](3) NOT NULL,
	[DPST_WTHDR_ACC_NM] [nvarchar](100) NULL,
	[DPST_WTHDR_TYPE] [varchar](2) NULL,
	[ACC_CD] [varchar](10) NULL,
	[PRNLS_TYPE] [varchar](1) NULL,
	[SPPLR_INPUT_TYPE] [varchar](1) NULL,
	[SALE_POS_USE_YN] [varchar](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_DPST_WTHDR_ACC_DTL] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[DRT_FRCS_DIV] ASC,
	[DPST_WTHDR_ACC_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_PAY_DC_CPN_ITEM]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_PAY_DC_CPN_ITEM](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[MOBILE_CPN_MNG_NO] [varchar](20) NOT NULL,
	[ITEM_CD] [varchar](20) NOT NULL,
	[QTY] [numeric](6, 0) NULL,
	[USE_YN] [char](1) NULL,
	[REG_USER_ID] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[DC_AMT] [numeric](15, 2) NULL,
 CONSTRAINT [PK_MST_PAY_DC_CPN_ITEM] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[MOBILE_CPN_MNG_NO] ASC,
	[ITEM_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_ITEM_SET]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_ITEM_SET](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[SUB_STOR_CD] [varchar](10) NOT NULL,
	[ITEM_CD] [varchar](30) NOT NULL,
	[SET_AUTO_DIV] [char](1) NOT NULL,
	[SEQ_NO] [int] NOT NULL,
	[SET_ITEM_DIV] [char](1) NULL,
	[SET_ITEM_CD] [varchar](30) NULL,
	[SET_ITEM_QTY] [int] NULL,
	[SET_GRPNM] [nvarchar](50) NULL,
	[SET_ITEM_GRP_CD] [varchar](4) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_ITEM_SET] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[SUB_STOR_CD] ASC,
	[ITEM_CD] ASC,
	[SET_AUTO_DIV] ASC,
	[SEQ_NO] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_ITEM_CLSS]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_ITEM_CLSS](
	[CMP_CD] [varchar](4) NOT NULL,
	[ITEM_CLSS_TYPE_CD] [varchar](5) NOT NULL,
	[ITEM_CLSS_CD] [varchar](12) NOT NULL,
	[ITEM_CLSS_NM] [nvarchar](100) NULL,
	[L_CLSS_CD] [varchar](4) NULL,
	[M_CLSS_CD] [varchar](4) NULL,
	[S_CLSS_CD] [varchar](4) NULL,
	[H_RANK_ITEM_CLSS_CD] [varchar](12) NULL,
	[ITEM_CLSS_LVL_TYPE] [char](1) NULL,
	[DISP_SEQ] [numeric](5, 0) NULL,
	[USE_YN] [char](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_ITEM_CLSS] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[ITEM_CLSS_TYPE_CD] ASC,
	[ITEM_CLSS_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_USER]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_USER](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[CASHIER_ID] [varchar](10) NOT NULL,
	[CASHIER_DIV] [char](1) NULL,
	[CASHIER_NM] [nvarchar](30) NULL,
	[CASHIER_PWD] [varchar](128) NULL,
	[CASHIER_CARD_NO] [varchar](128) NULL,
	[RTN_PWD] [varchar](128) NULL,
	[WEB_POS_PWD] [varchar](100) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_USER] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[CASHIER_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_CULTURE]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_CULTURE](
	[CMP_CD] [varchar](4) NOT NULL,
	[CULTURE_CD] [varchar](5) NOT NULL,
	[CULTURE_NM] [nvarchar](100) NULL,
	[MLT_CULT_ENG_NM] [nvarchar](100) NULL,
	[LANG_TYPE] [nvarchar](5) NULL,
	[NATN_TYPE] [nvarchar](100) NULL,
	[DT_PATTERN] [varchar](20) NULL,
	[CURR_SYMBL] [nvarchar](5) NULL,
	[CURR_NM] [nvarchar](50) NULL,
	[DEC_PNT_DIGITS] [int] NULL,
	[DEC_PNT_SYMBL] [nvarchar](5) NULL,
	[GRP_DIGITS] [int] NULL,
	[GRP_SYMBL] [nvarchar](5) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](15) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_CULTURE] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[CULTURE_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_FUNC_KEY]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_FUNC_KEY](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[FUNC_ID] [char](5) NOT NULL,
	[FUNC_NM] [nvarchar](90) NULL,
	[ASCII_CODE] [varchar](5) NULL,
	[TBL] [char](1) NULL,
	[ITEM_REG_BF] [char](1) NULL,
	[ITEM_REG_AF] [char](1) NULL,
	[PAY_POINT] [char](1) NULL,
	[PAY_DC] [char](1) NULL,
	[PAY_WAY] [char](1) NULL,
	[MENU_GRP] [char](1) NULL,
	[EXPLN] [nvarchar](100) NULL,
	[NORMAL] [char](1) NULL,
	[REFUND] [char](1) NULL,
	[TRN_MODE_0] [char](1) NULL,
	[TRN_MODE_1] [char](1) NULL,
	[TRN_MODE_2] [char](1) NULL,
	[TRN_MODE_3] [char](1) NULL,
	[TRN_MODE_4] [char](1) NULL,
	[TRN_MODE_5] [char](1) NULL,
	[TRN_MODE_6] [char](1) NULL,
	[TRN_MODE_7] [char](1) NULL,
	[TRN_MODE_8] [char](1) NULL,
	[TRN_MODE_9] [char](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_FUNC_KEY] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[FUNC_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_SUBPRC_MENU_GRP]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_SUBPRC_MENU_GRP](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[SUB_STOR_CD] [varchar](10) NOT NULL,
	[SUBPRC_MENU_GRP_CD] [varchar](4) NOT NULL,
	[SEQ_NO] [int] NOT NULL,
	[SUBPRC_MENU_KEY_DIV] [char](1) NULL,
	[SUBPRC_MENU_KEY_CD] [varchar](18) NULL,
	[LABEL_NM] [nvarchar](50) NULL,
	[SUBPRC_MENU_KEY_VAL] [varchar](30) NULL,
	[FONT_SIZE] [int] NULL,
	[FONT_COLOR] [varchar](9) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
	[UP_CHARGE_AMT] [numeric](15, 2) NULL,
 CONSTRAINT [PK_MST_SUBPRC_MENU_GRP] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[SUB_STOR_CD] ASC,
	[SUBPRC_MENU_GRP_CD] ASC,
	[SEQ_NO] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_POSMST_TABLE_LST]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_POSMST_TABLE_LST](
	[CMP_CD] [varchar](4) NOT NULL,
	[MST_TBL_CD] [varchar](2) NOT NULL,
	[MST_TBL_ID] [varchar](100) NULL,
	[MST_TBL_NM] [nvarchar](50) NULL,
	[EMG_DIV] [varchar](20) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_POSMST_TABLE_LST] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[MST_TBL_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_MSG]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_MSG](
	[CMP_CD] [varchar](4) NOT NULL,
	[LANG_CD] [varchar](10) NOT NULL,
	[MSG_TYPE] [char](1) NOT NULL,
	[MSG_NO] [char](8) NOT NULL,
	[MSG1] [nvarchar](100) NULL,
	[MSG2] [nvarchar](100) NULL,
	[MSG3] [nvarchar](100) NULL,
	[MSG4] [nvarchar](100) NULL,
	[MSG5] [nvarchar](100) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_MSG] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[LANG_CD] ASC,
	[MSG_TYPE] ASC,
	[MSG_NO] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_KTCH_DEVICE]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_KTCH_DEVICE](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[KTCH_SYS_CD] [varchar](4) NOT NULL,
	[KTCH_SYS_NM] [nvarchar](50) NULL,
	[KTCH_SYS_DIV] [char](1) NULL,
	[KTCH_SYS_USE_DIV] [char](1) NULL,
	[KTCH_PRINTER_COMM_PORT] [int] NULL,
	[KTCH_PRINTER_COMM_SPEED] [int] NULL,
	[KTCH_PRINTER_OPOS_NM] [varchar](50) NULL,
	[KTCH_PRINTER_IP] [varchar](20) NULL,
	[KTCH_PRINTER_PORT] [int] NULL,
	[KTCH_DSP_IP] [varchar](20) NULL,
	[KTCH_DSP_PORT] [int] NULL,
	[KTCH_DSP_DB_NM] [varchar](40) NULL,
	[KTCH_DSP_DB_USER_ID] [varchar](40) NULL,
	[KTCH_DSP_DB_PW] [varchar](40) NULL,
	[KTCH_PRINTER_BAK1] [varchar](4) NULL,
	[KTCH_PRINTER_BAK2] [varchar](4) NULL,
	[KTCH_PRINTER_BAK3] [varchar](4) NULL,
	[KTCH_PRINTER_BAK4] [varchar](4) NULL,
	[KTCH_PRINTER_BAK5] [varchar](4) NULL,
	[KTCH_PRINTER_BAK6] [varchar](4) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
	[SUB_STOR_CD] [varchar](10) NOT NULL,
	[PRT_CNT] [int] NULL,
	[POS_NO] [varchar](5) NOT NULL,
 CONSTRAINT [PK_MST_KTCH_DEVICE] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[SUB_STOR_CD] ASC,
	[POS_NO] ASC,
	[KTCH_SYS_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_ONLINE_CPN]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_ONLINE_CPN](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[CPN_DIV] [varchar](5) NOT NULL,
	[CPN_STAT] [varchar](1) NULL,
	[START_DAY] [varchar](8) NULL,
	[FNSH_DAY] [varchar](8) NULL,
	[PRRTY] [varchar](3) NULL,
	[PRT_MSG] [nvarchar](600) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_ONLINE_CPN] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[CPN_DIV] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_EXCHG_RATE]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_EXCHG_RATE](
	[EXCHG_RATE_REG_DT] [varchar](8) NOT NULL,
	[EXCHG_RATE_REG_DGRE] [numeric](5, 0) NOT NULL,
	[EXCHG_RATE_CD] [varchar](3) NOT NULL,
	[EXCHG_RATE_NM] [nvarchar](50) NULL,
	[EXCHG_RATE_AMT] [numeric](12, 5) NULL,
	[EXCHG_RATE_UNIT] [numeric](12, 5) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_EXCHG_RATE] PRIMARY KEY CLUSTERED
(
	[EXCHG_RATE_REG_DT] ASC,
	[EXCHG_RATE_REG_DGRE] ASC,
	[EXCHG_RATE_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_ITEM_BAR_CD]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_ITEM_BAR_CD](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[SUB_STOR_CD] [varchar](10) NOT NULL,
	[BAR_CD_NO] [varchar](30) NOT NULL,
	[ITEM_CD] [varchar](20) NOT NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_ITEM_BAR_CD] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[SUB_STOR_CD] ASC,
	[BAR_CD_NO] ASC,
        [ITEM_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_OUT_SD_VEND_ITEM]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_OUT_SD_VEND_ITEM](
	[CMP_CD] [varchar](4) NOT NULL,
	[OUT_SD_CMP_CD] [varchar](5) NOT NULL,
	[ITEM_CD] [varchar](20) NOT NULL,
	[ENTR_CMP_ITEM_CD] [varchar](20) NULL,
	[USE_YN] [char](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_OUT_SD_VEND_ITEM] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[OUT_SD_CMP_CD] ASC,
	[ITEM_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_STOR_INSPCT]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_STOR_INSPCT](
	[CMP_CD] [varchar](4) NOT NULL,
	[INSPCT_ENTRY_GRP_CD] [varchar](2) NOT NULL,
	[INSPCT_ENTRY_GRP_NM] [nvarchar](100) NULL,
	[POS_DIV] [varchar](1) NULL,
	[SALE_POS_ALARM_TYPE] [varchar](1) NULL,
	[SCORE_MNG_YN] [varchar](1) NULL,
	[QUE] [numeric](5, 0) NULL,
	[SALE_POS_ALARM_DT_APPNT_TYPE] [varchar](1) NULL,
	[DATE_1] [varchar](4) NULL,
	[DATE_2] [varchar](4) NULL,
	[WEEK] [varchar](1) NULL,
	[DOW] [varchar](1) NULL,
	[START_HOUR] [varchar](6) NULL,
	[FNSH_HOUR] [varchar](6) NULL,
	[SV_CONFRM_YN] [varchar](1) NULL,
	[ANSWR_POSS_DAY_CNT] [numeric](3, 0) NULL,
	[USE_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_STOR_INSPCT] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[INSPCT_ENTRY_GRP_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_ITEM_SET_GRP]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_ITEM_SET_GRP](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[SUB_STOR_CD] [varchar](10) NOT NULL,
	[SET_ITEM_GRP_CD] [varchar](4) NOT NULL,
	[SEQ_NO] [int] NOT NULL,
	[SET_ITEM_CD] [varchar](30) NULL,
	[LABEL_NM] [nvarchar](50) NULL,
	[SET_ITEM_UP_PRC] [numeric](15, 2) NULL,
	[FONT_SIZE] [int] NULL,
	[FONT_COLOR] [varchar](9) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_ITEM_SET_GRP] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[SUB_STOR_CD] ASC,
	[SET_ITEM_GRP_CD] ASC,
	[SEQ_NO] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_SALESORG_INSPCT_GRP]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_SALESORG_INSPCT_GRP](
	[CMP_CD] [varchar](4) NOT NULL,
	[BRAND_CD] [varchar](4) NOT NULL,
	[INSPCT_ENTRY_GRP_CD] [varchar](2) NOT NULL,
	[INSPCT_ENTRY_L_CLSS_CD] [varchar](3) NOT NULL,
	[INSPCT_ENTRY_L_CLSS_NM] [nvarchar](100) NULL,
	[INSPCT_GRP_DIV] [varchar](3) NULL,
	[TOT_SCORE] [numeric](15, 2) NULL,
	[USE_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_SALESORG_INSPCT_GRP] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[BRAND_CD] ASC,
	[INSPCT_ENTRY_GRP_CD] ASC,
	[INSPCT_ENTRY_L_CLSS_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_KTCH_PRINTER_TYPE_GRP]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_KTCH_PRINTER_TYPE_GRP](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[KTCH_PRINTER_TYPE_GRP_CD] [varchar](4) NOT NULL,
	[KTCH_PRINTER_TYPE_GRP_NM] [nvarchar](50) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_KTCH_PRINTER_TYPE_GRP] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[KTCH_PRINTER_TYPE_GRP_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_KTCH_PRINTER_TYPE]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_KTCH_PRINTER_TYPE](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[KTCH_PRINTER_TYPE_GRP_CD] [varchar](4) NOT NULL,
	[KTCH_PRINTER_TYPE_DIV] [varchar](2) NOT NULL,
	[SEQ_NO] [int] NOT NULL,
	[SORT_DIV] [char](1) NULL,
	[SIZE_DIV] [char](1) NULL,
	[KTCH_PRINTER_TYPE_TAG] [varchar](1000) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_KTCH_PRINTER_TYPE] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[KTCH_PRINTER_TYPE_GRP_CD] ASC,
	[KTCH_PRINTER_TYPE_DIV] ASC,
	[SEQ_NO] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_SALESORG_INSPCT_DTL]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_SALESORG_INSPCT_DTL](
	[CMP_CD] [varchar](4) NOT NULL,
	[BRAND_CD] [varchar](4) NOT NULL,
	[INSPCT_ENTRY_GRP_CD] [varchar](2) NOT NULL,
	[INSPCT_ENTRY_L_CLSS_CD] [varchar](3) NOT NULL,
	[INSPCT_ENTRY] [numeric](4, 0) NOT NULL,
	[INSPCT_ENTRY_NM] [nvarchar](1000) NULL,
	[INPUT_DIV] [varchar](1) NULL,
	[SEL_ENTRY_CNT] [numeric](2, 0) NULL,
	[SEL_ENTRY_1] [nvarchar](100) NULL,
	[SEL_ENTRY_2] [nvarchar](100) NULL,
	[SEL_ENTRY_3] [nvarchar](100) NULL,
	[SEL_ENTRY_4] [nvarchar](100) NULL,
	[SEL_ENTRY_5] [nvarchar](100) NULL,
	[SCORE_1] [numeric](15, 2) NULL,
	[SCORE_2] [numeric](15, 2) NULL,
	[SCORE_3] [numeric](15, 2) NULL,
	[SCORE_4] [numeric](15, 2) NULL,
	[SCORE_5] [numeric](15, 2) NULL,
	[QUE] [numeric](3, 0) NULL,
	[NOTE_MNDTRY_INPUT_YN] [varchar](1) NULL,
	[TRGT_DIV] [varchar](2) NULL,
	[EXEC_CYCLE_DIV] [varchar](1) NULL,
	[USE_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_SALESORG_INSPCT_DTL] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[BRAND_CD] ASC,
	[INSPCT_ENTRY_GRP_CD] ASC,
	[INSPCT_ENTRY_L_CLSS_CD] ASC,
	[INSPCT_ENTRY] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_CARD_CMP]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_CARD_CMP](
	[CMP_CD] [varchar](4) NOT NULL,
	[CARD_CMP_CD] [varchar](2) NOT NULL,
	[CARD_CMP_NM] [nvarchar](100) NULL,
	[CARD_CMP_DIV] [varchar](1) NULL,
	[CMMSNRATE] [numeric](6, 4) NULL,
	[BIZ_PSN_NO] [varchar](20) NULL,
	[TEL_NO] [varchar](20) NULL,
	[FAX_NO] [varchar](20) NULL,
	[HOME_PAGE] [varchar](100) NULL,
	[SALES_ORG_CD] [varchar](4) NULL,
	[GRP_CD] [varchar](2) NULL,
	[TERM_DIV] [varchar](1) NULL,
	[TERM_RTN_NO] [varchar](10) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_CARD_CMP] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[CARD_CMP_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_GIF]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_GIF](
	[GIF_CD] [varchar](4) NOT NULL,
	[GIF_SHORT_NM] [nvarchar](60) NULL,
	[GIF_NM] [nvarchar](60) NULL,
	[BRAND_CD] [varchar](4) NULL,
	[GIF_FIX_BRAND_CD] [varchar](4) NULL,
	[GIF_AMT] [numeric](15, 2) NULL,
	[APPR_YN] [char](1) NULL,
	[MNDTRY_INPUT_YN] [char](1) NULL,
	[BTN_BACKGRCOLOR] [varchar](9) NULL,
	[FONT_COLOR] [varchar](9) NULL,
	[IMG_USE_YN] [char](1) NULL,
	[IMG_PATH] [nvarchar](100) NULL,
	[HP_ACCUM_YN] [char](1) NULL,
	[APPR_SVR_DIV] [char](1) NULL,
	[SORT_QUE] [numeric](5, 0) NULL,
	[CHANGE_PAYMNT_YN] [char](1) NULL,
	[HPY_GIF_DIV] [varchar](1) NULL,
	[USE_YN] [char](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_GIF] PRIMARY KEY CLUSTERED
(
	[GIF_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_PGM_VER_NEW]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_PGM_VER_NEW](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[POS_NO] [varchar](2) NOT NULL,
	[KIND] [varchar](4) NOT NULL,
	[FILE_SEQ] [numeric](5, 0) NOT NULL,
	[FILE_VER] [varchar](30) NOT NULL,
	[FILE_NM] [varchar](40) NULL,
	[APPLY_DATE] [varchar](8) NOT NULL,
	[APPLY_TIME] [varchar](4) NULL,
	[DEPLOY_DATE] [varchar](8) NULL,
	[DEPLOY_TIME] [varchar](4) NULL,
	[APP_TYPE] [varchar](1) NULL,
	[FTP_IP] [varchar](20) NULL,
	[FTP_PORT] [varchar](20) NULL,
	[FTP_ID] [varchar](20) NULL,
	[FTP_PWD] [varchar](20) NULL,
	[FTP_FILEPATH] [varchar](500) NULL,
	[DOWN_DIV] [varchar](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[DEPLOY_DT] [varchar](8) NULL,
	[USE_YN] [char](1) NULL,
 CONSTRAINT [PK_MST_PGM_VER_NEW] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[POS_NO] ASC,
	[KIND] ASC,
	[FILE_SEQ] ASC,
	[FILE_VER] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_TERM_COOP_CMP_PAY_DC]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_TERM_COOP_CMP_PAY_DC](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[PAY_DC_GRP_TYPE] [varchar](2) NOT NULL,
	[PAY_DC_CD] [varchar](2) NOT NULL,

	--#14231 KT 웰컴기프트 카드 기능 개발, PHJ START
	--기존
	--[COOP_CMP_GRADE_CD] [varchar](2) NOT NULL,
	--수정
	[COOP_CMP_GRADE_CD] [varchar](4) NOT NULL,
	--#14231 KT 웰컴기프트 카드 기능 개발, PHJ END

	[START_DT] [varchar](8) NOT NULL,
	[FNSH_DT] [varchar](8) NULL,
	[DC_APPLY_TRGT] [char](1) NULL,
	[PAY_DC_METHD] [char](1) NULL,
	[PAY_DC_VAL] [numeric](15, 2) NULL,
	[PAY_DC_AMT_STD_PAY_AMT] [numeric](15, 2) NULL,
	[PAY_DC_DEC_PNT_CALC_METHD] [char](1) NULL,
	[PAY_DC_CALC_DIGT_NO] [numeric](2, 0) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_TERM_COOP_CMP_PAY_DC] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[PAY_DC_GRP_TYPE] ASC,
	[PAY_DC_CD] ASC,
	[COOP_CMP_GRADE_CD] ASC,
	[START_DT] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_KTCH_DEVICE_ITEM]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_KTCH_DEVICE_ITEM](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[KTCH_SYS_CD] [varchar](4) NOT NULL,
	[FLOOR_CD] [varchar](3) NOT NULL,
	[ITEM_CD] [varchar](20) NOT NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[USE_YN] [char](1) NULL,
	[SUB_STOR_CD] [varchar](10) NOT NULL,
 CONSTRAINT [PK_MST_KTCH_DEVICE_ITEM] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[SUB_STOR_CD] ASC,
	[KTCH_SYS_CD] ASC,
	[FLOOR_CD] ASC,
	[ITEM_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_STOR]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_STOR](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[BRAND_CD] [varchar](4) NULL,
	[STOR_OWN_NM] [nvarchar](30) NULL,
	[STORNM] [nvarchar](30) NULL,
	[STOR_ADDR] [nvarchar](500) NULL,
	[BIZ_PSN_NO] [varchar](15) NULL,
	[TELNO] [varchar](20) NOT NULL,
	[POS_OPER_LCNT] [int] NULL,
	[SVC_FEE_DIV] [char](1) NULL,
	[SVC_FEE] [numeric](15, 2) NULL,
	[SVC_FEE_APPLYTRGT_DIV] [char](1) NULL,
	[SVC_FEE_TAX_AMT_APPLYDIV] [char](1) NULL,
	[VAT_RUD_DW_LOC] [int] NULL,
	[VAT_RUD_DW_METHD] [char](1) NULL,
	[DC_RUD_DW_LOC] [int] NULL,
	[DC_RUD_DW_METHD] [char](1) NULL,
	[ITEM_RUD_DW_LOC] [int] NULL,
	[DRT_FRCS_DIV] [varchar](2) NULL,
	[HPY_PNT_ACCUMRATE] [numeric](5, 2) NULL,
	[TAX_AMT_INCLUDE_YN] [char](1) NULL,
	[TAX_AMT_CALC_METHD] [char](1) NULL,
	[TAX_AMT_APPLY_DIV] [char](1) NULL,
	[BASIC_TAKE_IN_TAX_CD] [varchar](5) NULL,
	[BASIC_TAKE_OUT_TAX_CD] [varchar](5) NULL,
	[MLT_CULT_CD] [varchar](5) NULL,
	[TIMEGAP] [int] NULL,
	[HPYORD_AGREEYN] [char](1) NULL,
	[GIF_SALE_YN] [char](1) NULL,
	[BILL_MSG_DUP_PRMT_YN] [char](1) NULL,
	[BILL_MSG_PRT_RANK] [char](1) NULL,
	[RESERV_SALE_YN] [char](1) NULL,
	[COMPLEX_SHOP_TYPE] [char](1) NULL,
	[TEST_STOR_YN] [char](1) NULL,
	[CDP_USE_YN] [char](1) NULL,
	[CDP_MSG] [nvarchar](100) NULL,
	[LOAN_LAW_CERTF_YN] [char](1) NULL,
	[HAPPY_BUZZ_USE_YN] [char](1) NULL,
	[BROWSER_KEY] [varchar](10) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[USE_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
	[OUT_SD_VEND_CON_NO] [varchar](10) NULL,
	[OUT_SD_VEND_CRNR_CD] [varchar](20) NULL,
	[CORP_DIV] [varchar](10) NULL,
	[CNTRY_DIV] [varchar](10) NULL,
	[ETC_IF_DIV] [varchar](7) NULL,
	[ETC_IF_FTP_IP] [varchar](20) NULL,
	[ETC_IF_FTP_PORT] [varchar](6) NULL,
	[ETC_IF_FTP_ID] [varchar](10) NULL,
	[ETC_IF_FTP_PW] [varchar](10) NULL,
	[ETC_IF_FTP_PASSIVE] [varchar](2) NULL,
	[ETC_IF_FTP_PATH] [varchar](100) NULL,
	[ETC_IF_URL1] [varchar](150) NULL,
	[ETC_IF_URL2] [varchar](150) NULL,
	[ETC_IF_POS_DIV] [varchar](1) NULL,
 CONSTRAINT [PK_MST_STOR] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_STR_DAILY_INSPCT_LIST]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_STR_DAILY_INSPCT_LIST](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[INSPCT_CD] [varchar](3) NOT NULL,
	[USE_YN] [char](1) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
 CONSTRAINT [PK_MST_STR_DAILY_INSPCT_LIST] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[INSPCT_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
-- 2017.09.11 레시피 마스터 추가 SeokWoo Moon
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_KTCH_ITEM_INFO]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_KTCH_ITEM_INFO](
	[CMP_CD] [varchar](4) NOT NULL,
	[STOR_CD] [varchar](10) NOT NULL,
	[SUB_STOR_CD] [varchar](10) NOT NULL,
	[ITEM_CD] [varchar](20) NOT NULL,
	[ITEM_INFO] [nvarchar](200) NULL,
	[USE_YN] [char](1) NULL,
	[FILLER1] [varchar](50) NULL,
	[FILLER2] [varchar](50) NULL,
	[FILLER3] [varchar](50) NULL,
	[FILLER4] [varchar](50) NULL,
	[FILLER5] [varchar](50) NULL,
	[UPD_DT] [varchar](14) NULL,
	[REG_DT] [varchar](14) NULL,
        --#20180515 KPS 출력시 라벨프린터 출력 start
	[LBL_QRCODE_URL] [varchar](200) NULL,
	[LBL_QRCODE_MSG] [varchar](200) NULL,
	[LBL_TOP_MSG] [varchar](200) NULL,
	[LBL_BTM_MSG] [varchar](200) NULL,
        --#20180515 KPS 출력시 라벨프린터 출력 end
 CONSTRAINT [PK_MST_KTCH_ITEM_INFO] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[SUB_STOR_CD] ASC,
	[ITEM_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO


--#20171116 온라인 쿠폰 제품군코드,상품코드 존재 시 할인 대상이 변경되도록 추가 start, phj
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_CPN_ITEM_GRP_MNG]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_CPN_ITEM_GRP_MNG](
  [CMP_CD]         [VARCHAR](4)       NOT NULL,
  [ITEM_GRP_CD]    [VARCHAR](20)      NOT NULL,
  [ITEM_GRP_NM]    [VARCHAR](135)         NULL,
  [USE_YN]         [VARCHAR](1)           NULL,
  [UPD_DATE]       [varchar](14)          NULL,
  [REG_DATE]       [varchar](14)          NULL,
  -- 20180509 온라인쿠폰 대,중,소 START,PHJ
  [GUBUN]          [varchar](2)           NULL
  -- 20180509 온라인쿠폰 대,중,소 END,PHJ

 CONSTRAINT [PK_MST_CPN_ITEM_GRP_MNG] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[ITEM_GRP_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
)  ON [PRIMARY]
END
GO

SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MST_CPN_ITEM_GRP_MNG_DTL]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[MST_CPN_ITEM_GRP_MNG_DTL](
  [CMP_CD]         [VARCHAR](4)      NOT NULL,
  [ITEM_GRP_CD]    [VARCHAR](20)     NOT NULL,
  [ITEM_CD]        [VARCHAR](20)     NOT NULL,
  [USE_YN]         [VARCHAR](1)          NULL,
  [UPD_DATE]       [varchar](14)         NULL,
  [REG_DATE]       [varchar](14)         NULL

 CONSTRAINT [PK_MST_CPN_ITEM_GRP_MNG_DTL] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[ITEM_GRP_CD] ASC,
    [ITEM_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
)  ON [PRIMARY]
END
GO

--#20171116 온라인 쿠폰 제품군코드,상품코드 존재 시 할인 대상이 변경되도록 추가 end, phj

--#20180418 고객 구매이력 정보 표시 및 해피쿠폰 발송 start, 20180510
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[STR_SEND_CPN_MST]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[STR_SEND_CPN_MST](
  [CMP_CD]         [VARCHAR](4)       NOT NULL,
  [STOR_CD]        [VARCHAR](10)      NOT NULL,
  [HAPPY_YN]       [VARCHAR](1)       NULL,
  [PRINT_YN]       [VARCHAR](1)       NULL,
  [SEND_YN]        [varchar](1)       NULL,
  [REG_DATE]       [varchar](14)      NULL,
  [UPD_DATE]       [varchar](14)      NULL,
  --#20180418 고객 구매이력 정보 표시 및 해피쿠폰 발송 start, 20180528
  [CPN_SEND_LIMIT_CNT] [numeric](3, 0) NULL,
  --#20180418 고객 구매이력 정보 표시 및 해피쿠폰 발송 end, 20180528
 CONSTRAINT [PK_STR_SEND_CPN_MST] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
)  ON [PRIMARY]
END
GO

SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[STR_SEND_CPN_DTL]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[STR_SEND_CPN_DTL](
  [CMP_CD]         [VARCHAR](4)       NOT NULL,
  [STOR_CD]        [VARCHAR](10)      NOT NULL,
  [CODE]           [VARCHAR](4)       NOT NULL,
  [USE_YN]         [VARCHAR](1)       NULL,
  [REG_DATE]       [varchar](14)      NULL,
  [UPD_DATE]       [varchar](14)      NULL,
 CONSTRAINT [PK_STR_SEND_CPN_DTL] PRIMARY KEY CLUSTERED
(
	[CMP_CD] ASC,
	[STOR_CD] ASC,
	[CODE] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
)  ON [PRIMARY]
END
GO
--#20180418 고객 구매이력 정보 표시 및 해피쿠폰 발송 end, 20180510

SET ANSI_PADDING OFF
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_CARD_CMP_CARD_CMP_NM]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_CARD_CMP]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_CARD_CMP_CARD_CMP_NM]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_CARD_CMP] ADD  CONSTRAINT [DF_MST_CARD_CMP_CARD_CMP_NM]  DEFAULT ('') FOR [CARD_CMP_NM]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_CARD_CMP_CARD_CMP_DIV]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_CARD_CMP]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_CARD_CMP_CARD_CMP_DIV]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_CARD_CMP] ADD  CONSTRAINT [DF_MST_CARD_CMP_CARD_CMP_DIV]  DEFAULT ('') FOR [CARD_CMP_DIV]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_CARD_CMP_CMMSNRATE]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_CARD_CMP]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_CARD_CMP_CMMSNRATE]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_CARD_CMP] ADD  CONSTRAINT [DF_MST_CARD_CMP_CMMSNRATE]  DEFAULT ((0)) FOR [CMMSNRATE]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_CARD_CMP_BIZ_PSN_NO]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_CARD_CMP]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_CARD_CMP_BIZ_PSN_NO]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_CARD_CMP] ADD  CONSTRAINT [DF_MST_CARD_CMP_BIZ_PSN_NO]  DEFAULT ('') FOR [BIZ_PSN_NO]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_CARD_CMP_TEL_NO]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_CARD_CMP]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_CARD_CMP_TEL_NO]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_CARD_CMP] ADD  CONSTRAINT [DF_MST_CARD_CMP_TEL_NO]  DEFAULT ('') FOR [TEL_NO]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_CARD_CMP_FAX_NO]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_CARD_CMP]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_CARD_CMP_FAX_NO]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_CARD_CMP] ADD  CONSTRAINT [DF_MST_CARD_CMP_FAX_NO]  DEFAULT ('') FOR [FAX_NO]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_CARD_CMP_HOME_PAGE]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_CARD_CMP]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_CARD_CMP_HOME_PAGE]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_CARD_CMP] ADD  CONSTRAINT [DF_MST_CARD_CMP_HOME_PAGE]  DEFAULT ('') FOR [HOME_PAGE]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_CARD_CMP_SALES_ORG_CD]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_CARD_CMP]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_CARD_CMP_SALES_ORG_CD]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_CARD_CMP] ADD  CONSTRAINT [DF_MST_CARD_CMP_SALES_ORG_CD]  DEFAULT ('') FOR [SALES_ORG_CD]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_CARD_CMP_GRP_CD]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_CARD_CMP]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_CARD_CMP_GRP_CD]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_CARD_CMP] ADD  CONSTRAINT [DF_MST_CARD_CMP_GRP_CD]  DEFAULT ('') FOR [GRP_CD]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_CARD_CMP_TERM_DIV]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_CARD_CMP]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_CARD_CMP_TERM_DIV]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_CARD_CMP] ADD  CONSTRAINT [DF_MST_CARD_CMP_TERM_DIV]  DEFAULT ('') FOR [TERM_DIV]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_CARD_CMP_TERM_RTN_NO]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_CARD_CMP]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_CARD_CMP_TERM_RTN_NO]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_CARD_CMP] ADD  CONSTRAINT [DF_MST_CARD_CMP_TERM_RTN_NO]  DEFAULT ('') FOR [TERM_RTN_NO]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_CARD_CMP_UPD_DT]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_CARD_CMP]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_CARD_CMP_UPD_DT]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_CARD_CMP] ADD  CONSTRAINT [DF_MST_CARD_CMP_UPD_DT]  DEFAULT ('') FOR [UPD_DT]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_CARD_CMP_REG_DT]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_CARD_CMP]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_CARD_CMP_REG_DT]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_CARD_CMP] ADD  CONSTRAINT [DF_MST_CARD_CMP_REG_DT]  DEFAULT ('') FOR [REG_DT]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_CARD_CMP_USE_YN]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_CARD_CMP]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_CARD_CMP_USE_YN]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_CARD_CMP] ADD  CONSTRAINT [DF_MST_CARD_CMP_USE_YN]  DEFAULT ('') FOR [USE_YN]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_DC_DTL_BRAND_CD]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_DC_DTL]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_DC_DTL_BRAND_CD]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_DC_DTL] ADD  CONSTRAINT [DF_MST_DC_DTL_BRAND_CD]  DEFAULT (' ') FOR [BRAND_CD]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_DC_DTL_DC_DIV]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_DC_DTL]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_DC_DTL_DC_DIV]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_DC_DTL] ADD  CONSTRAINT [DF_MST_DC_DTL_DC_DIV]  DEFAULT ((1)) FOR [DC_DIV]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_EMG_NOTE_DOWN_YN]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_EMG_NOTE]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_EMG_NOTE_DOWN_YN]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_EMG_NOTE] ADD  CONSTRAINT [DF_MST_EMG_NOTE_DOWN_YN]  DEFAULT ('0') FOR [DOWN_YN]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF__MST_ITEM___SUB_S__1FF970CB]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_ITEM_KEY_COMPNT]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF__MST_ITEM___SUB_S__1FF970CB]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_ITEM_KEY_COMPNT] ADD  DEFAULT ('') FOR [SUB_STOR_CD]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF__MST_KTCH___SUB_S__02DE0F30]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_KTCH_DEVICE]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF__MST_KTCH___SUB_S__02DE0F30]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_KTCH_DEVICE] ADD  DEFAULT ('') FOR [SUB_STOR_CD]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF__MST_KTCH___SUB_S__04C657A2]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_KTCH_DEVICE_ITEM]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF__MST_KTCH___SUB_S__04C657A2]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_KTCH_DEVICE_ITEM] ADD  DEFAULT ('') FOR [SUB_STOR_CD]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_PGM_VER_FILE_NM]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_PGM_VER]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_PGM_VER_FILE_NM]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_PGM_VER] ADD  CONSTRAINT [DF_MST_PGM_VER_FILE_NM]  DEFAULT (' ') FOR [FILE_NM]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_PGM_VER_APP_TYPE]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_PGM_VER]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_PGM_VER_APP_TYPE]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_PGM_VER] ADD  CONSTRAINT [DF_MST_PGM_VER_APP_TYPE]  DEFAULT (' ') FOR [APP_TYPE]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_PGM_VER_UPD_DT]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_PGM_VER]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_PGM_VER_UPD_DT]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_PGM_VER] ADD  CONSTRAINT [DF_MST_PGM_VER_UPD_DT]  DEFAULT (' ') FOR [UPD_DT]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_PGM_VER_REG_DT]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_PGM_VER]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_PGM_VER_REG_DT]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_PGM_VER] ADD  CONSTRAINT [DF_MST_PGM_VER_REG_DT]  DEFAULT (getdate()) FOR [REG_DT]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_PGM_VER_NEW_FILE_NM]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_PGM_VER_NEW]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_PGM_VER_NEW_FILE_NM]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_PGM_VER_NEW] ADD  CONSTRAINT [DF_MST_PGM_VER_NEW_FILE_NM]  DEFAULT (' ') FOR [FILE_NM]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_PGM_VER_NEW_APPLY_DATE]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_PGM_VER_NEW]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_PGM_VER_NEW_APPLY_DATE]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_PGM_VER_NEW] ADD  CONSTRAINT [DF_MST_PGM_VER_NEW_APPLY_DATE]  DEFAULT (' ') FOR [APPLY_DATE]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_PGM_VER_NEW_APPLY_TIME]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_PGM_VER_NEW]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_PGM_VER_NEW_APPLY_TIME]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_PGM_VER_NEW] ADD  CONSTRAINT [DF_MST_PGM_VER_NEW_APPLY_TIME]  DEFAULT (' ') FOR [APPLY_TIME]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_PGM_VER_NEW_DEPLOY_DATE]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_PGM_VER_NEW]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_PGM_VER_NEW_DEPLOY_DATE]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_PGM_VER_NEW] ADD  CONSTRAINT [DF_MST_PGM_VER_NEW_DEPLOY_DATE]  DEFAULT (' ') FOR [DEPLOY_DATE]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_PGM_VER_NEW_DEPLOY_TIME]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_PGM_VER_NEW]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_PGM_VER_NEW_DEPLOY_TIME]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_PGM_VER_NEW] ADD  CONSTRAINT [DF_MST_PGM_VER_NEW_DEPLOY_TIME]  DEFAULT (' ') FOR [DEPLOY_TIME]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_PGM_VER_NEW_APP_TYPE]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_PGM_VER_NEW]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_PGM_VER_NEW_APP_TYPE]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_PGM_VER_NEW] ADD  CONSTRAINT [DF_MST_PGM_VER_NEW_APP_TYPE]  DEFAULT (' ') FOR [APP_TYPE]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_PGM_VER_NEW_FTP_IP]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_PGM_VER_NEW]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_PGM_VER_NEW_FTP_IP]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_PGM_VER_NEW] ADD  CONSTRAINT [DF_MST_PGM_VER_NEW_FTP_IP]  DEFAULT (' ') FOR [FTP_IP]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_PGM_VER_NEW_FTP_PORT]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_PGM_VER_NEW]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_PGM_VER_NEW_FTP_PORT]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_PGM_VER_NEW] ADD  CONSTRAINT [DF_MST_PGM_VER_NEW_FTP_PORT]  DEFAULT ('0') FOR [FTP_PORT]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_PGM_VER_NEW_FTP_ID]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_PGM_VER_NEW]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_PGM_VER_NEW_FTP_ID]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_PGM_VER_NEW] ADD  CONSTRAINT [DF_MST_PGM_VER_NEW_FTP_ID]  DEFAULT (' ') FOR [FTP_ID]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_PGM_VER_NEW_FTP_PWD]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_PGM_VER_NEW]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_PGM_VER_NEW_FTP_PWD]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_PGM_VER_NEW] ADD  CONSTRAINT [DF_MST_PGM_VER_NEW_FTP_PWD]  DEFAULT (' ') FOR [FTP_PWD]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_PGM_VER_NEW_FTP_FILEPATH]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_PGM_VER_NEW]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_PGM_VER_NEW_FTP_FILEPATH]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_PGM_VER_NEW] ADD  CONSTRAINT [DF_MST_PGM_VER_NEW_FTP_FILEPATH]  DEFAULT (' ') FOR [FTP_FILEPATH]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_PGM_VER_NEW_DOWN_DIV]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_PGM_VER_NEW]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_PGM_VER_NEW_DOWN_DIV]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_PGM_VER_NEW] ADD  CONSTRAINT [DF_MST_PGM_VER_NEW_DOWN_DIV]  DEFAULT ('0') FOR [DOWN_DIV]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_PGM_VER_NEW_UPD_DT]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_PGM_VER_NEW]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_PGM_VER_NEW_UPD_DT]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_PGM_VER_NEW] ADD  CONSTRAINT [DF_MST_PGM_VER_NEW_UPD_DT]  DEFAULT (' ') FOR [UPD_DT]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF_MST_PGM_VER_NEW_REG_DT]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_PGM_VER_NEW]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_MST_PGM_VER_NEW_REG_DT]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_PGM_VER_NEW] ADD  CONSTRAINT [DF_MST_PGM_VER_NEW_REG_DT]  DEFAULT (getdate()) FOR [REG_DT]
END


End
GO
IF Not EXISTS (SELECT * FROM sys.default_constraints WHERE object_id = OBJECT_ID(N'[dbo].[DF__MST_TBL__TRAIN_M__265233F6]') AND parent_object_id = OBJECT_ID(N'[dbo].[MST_TBL]'))
Begin
IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF__MST_TBL__TRAIN_M__265233F6]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[MST_TBL] ADD  CONSTRAINT [DF__MST_TBL__TRAIN_M__265233F6]  DEFAULT ('0') FOR [TRAIN_MODE_YN]
END

END
GO

IF EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'MST_KDS_ORD_MSG' AND COLUMN_NAME = 'ORD_TIME')
BEGIN
	ALTER TABLE MST_KDS_ORD_MSG ALTER COLUMN ORD_TIME VARCHAR(11) NULL;
END
GO

IF EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'MST_KTCH_ORD_MSG' AND COLUMN_NAME = 'ORD_TIME')
BEGIN
	ALTER TABLE MST_KTCH_ORD_MSG ALTER COLUMN ORD_TIME VARCHAR(11) NULL;
END
GO

