20071217
20071226
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MS_MENU_DC]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[MS_MENU_DC]
GO

CREATE TABLE [dbo].[MS_MENU_DC] (
	[cd_store] [varchar] (4) COLLATE Korean_Wansung_CI_AS NOT NULL ,
	[ds_member] [varchar] (3) COLLATE Korean_Wansung_CI_AS NOT NULL ,
	[cd_menu] [varchar] (13) COLLATE Korean_Wansung_CI_AS NOT NULL ,
	[dc_rate] [int] NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[MS_MENU_DC] ADD 
	CONSTRAINT [DF_MS_MENU_DC_dc_rate] DEFAULT (0) FOR [dc_rate],
	CONSTRAINT [PK_MS_MENU_DC] PRIMARY KEY  CLUSTERED 
	(
		[cd_store],
		[ds_member],
		[cd_menu]
	)  ON [PRIMARY] 
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[POS_SELECT_MEMBER]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[POS_SELECT_MEMBER]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO


--회원조회
CREATE PROCEDURE POS_SELECT_MEMBER
	@CD_STORE		VARCHAR(4),
	@CD_MEMBER		VARCHAR(10),
	@YMD_BEGIN		VARCHAR(10) OUTPUT,
	@YMD_END		VARCHAR(10) OUTPUT,
	@NM_GOODS		VARCHAR(50) OUTPUT,
	@CD_MENU		VARCHAR(14) OUTPUT,
	@NM_MENU		VARCHAR(50) OUTPUT,
	@LOCKER		VARCHAR(50) OUTPUT,
	@ALLOW_TOTCNT	INT	OUTPUT,
	@ALLOW_DAYCNT	INT	OUTPUT,
	@USE_TOT		INT	OUTPUT
AS
BEGIN

	DECLARE	@TODATE	DATETIME

	SET @TODATE = convert(VARCHAR(8), GETDATE(), 112) 

	IF LEN(@CD_MEMBER) <> 10
	BEGIN
		SELECT @CD_MEMBER  = CD_MEMBER FROM MS_MEMBER_CARD WHERE DS_STATUS = '0' AND NO_CARD = @CD_MEMBER
	END


	SELECT A.CD_MEMBER,
		 A.NM_MEMBER,
                            A.DS_MEMBER AS CD_CLASS,
		 B.NM_CODE1	AS DS_MEMBER,
		 B.NM_CODE2	AS DC_RATE,
		 A.TEL_MOBIL,
		 ISNULL( (SELECT TOP 1 NO_CARD FROM MS_MEMBER_CARD WHERE CD_MEMBER = A.CD_MEMBER AND DS_STATUS = '0' ), '') AS NO_CARD,
		 A.YMD_VISIT,
		 A.CNT_VISIT,
		 A.YN_TRUST,
		 (SELECT ISNULL(PNT_TOTAL,0) FROM SL_POINT WHERE CD_MEMBER = A.CD_MEMBER ) AS PNT_TOTAL,
		 (SELECT COUNT(*) FROM SL_MEMBER_USE WHERE CD_MEMBER = A.CD_MEMBER AND  CONVERT(VARCHAR(8), DT_SALE, 112)  = CONVERT(VARCHAR(8), GETDATE(), 112)  )  AS USE_DAY,
		CASE A.DS_SEX WHEN '0' THEN '남자' WHEN '1' THEN '여자' END AS GENDER,
	             (SELECT TOP 1 NEWS_TXT FROM SL_MEMBER_NEWS WHERE CD_MEMBER =@CD_MEMBER AND DS_STATUS = '0' ORDER BY SEQ DESC) AS NEWS_TXT
	FROM MS_MEMBER A, MS_CODE B
          WHERE  A.DS_MEMBER	*= B.CD_CODE
	   AND  B.CD_KIND	= '05'
	   AND  B.CD_STORE	=@CD_STORE
	   AND  A.CD_MEMBER	=@CD_MEMBER

	SELECT  @YMD_BEGIN	=A.YMD_BEGIN, 
		  @YMD_END		=A.YMD_END, 
		  @NM_GOODS		=B.NM_GOODS, 
		  @CD_MENU		=C.CD_MENU, 
		  @NM_MENU		=C.NM_MENU,
		  @ALLOW_TOTCNT	=B.ALLOW_TOTCNT,
		  @ALLOW_DAYCNT	=B.ALLOW_DAYCNT,
		  @USE_TOT		=(SELECT COUNT(*) FROM SL_MEMBER_USE WHERE CD_MEMBER = A.CD_MEMBER AND  CONVERT(VARCHAR(8), DT_SALE, 112)  BETWEEN A.YMD_BEGIN AND A.YMD_END ) 
	   FROM SL_MEMBER_JOIN A, MS_GOODS B, MS_MENU C
	WHERE A.CD_GOODS		= B.CD_GOODS
	      AND B.CD_MENU		= C.CD_MENU
	      AND A.DS_STATUS		= '0'
	      AND A.CD_MEMBER	=@CD_MEMBER
	      AND A.YMD_BEGIN <= @TODATE 
                   AND A.YMD_FINISH >= @TODATE
	      AND NOT ( (ISNULL(A.DELAY_BEGIN,@TODATE) <= @TODATE) AND (ISNULL(A.DELAY_TO,@TODATE) <= @TODATE)) 


	SELECT @LOCKER =  DBO.GETCOMMONNAME(@CD_STORE, '03', A.CD_PLACE) +'-'+ A.NO_LOCKER + ' ( '+DBO.GETCOMMONNAME(@CD_STORE, '04', B.CD_LOCKER) +' )' 
	   FROM SL_LOCKER A, MS_LOCKER B
	WHERE A.CD_PLACE	= B.CD_PLACE
	      AND A.NO_LOCKER	= B.NO_LOCKER
	      AND A.CD_MEMBER = @CD_STORE


	SET @YMD_BEGIN 	= ISNULL(@YMD_BEGIN,'')
	SET @YMD_END 	= ISNULL(@YMD_END,'')
	SET @NM_GOODS 	= ISNULL(@NM_GOODS,'')
	SET @CD_MENU 	= ISNULL(@CD_MENU,'')
	SET @NM_MENU 	= ISNULL(@NM_MENU,'')
	SET @LOCKER 	= ISNULL(@LOCKER,'')
	SET @USE_TOT	= ISNULL(@USE_TOT,0)
	SET @ALLOW_TOTCNT	= ISNULL(@ALLOW_TOTCNT,0)
	SET @ALLOW_DAYCNT	= ISNULL(@ALLOW_DAYCNT,0)

END
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

if not exists(select * from information_schema.columns where TABLE_NAME='sl_order_d' and COLUMN_NAME='cd_damdang')
BEGIN
ALTER TABLE sl_order_d
ADD cd_damdang varchar(6)
END
GO

if not exists(select * from information_schema.columns where TABLE_NAME='sl_sale_d' and COLUMN_NAME='cd_damdang')
BEGIN
ALTER TABLE sl_sale_d
ADD cd_damdang varchar(6)
END
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[POS_SAVE_ORDER_D]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[POS_SAVE_ORDER_D]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO




CREATE    PROCEDURE POS_SAVE_ORDER_D

	@CD_STORE 	    		VARCHAR(4),
	@DS_LOCK			VARCHAR(3),
	@NO_LOCK			VARCHAR(4),
	@CD_MENU			VARCHAR(14),
	@DS_SALE			VARCHAR(1),
	@PR_SALE			INT,
	@QTY_SALE			INT,
	@AMT_SALE			INT,
	@NO_POS			VARCHAR(2),
	@CD_DAMDANG		VARCHAR(6)
AS
BEGIN

	DECLARE	@SEQ	INT

	SELECT @SEQ = ISNULL(MAX(SEQ),0)+1 
	   FROM SL_ORDER_D
	WHERE CD_STORE		=@CD_STORE
	      AND DS_LOCK		=@DS_LOCK
	      AND NO_LOCK		=@NO_LOCK

	INSERT INTO SL_ORDER_D(
					CD_STORE,
					DS_LOCK,
					NO_LOCK,
					CD_MENU,
					SEQ,
					DS_SALE,
					PR_SALE,
					QTY_SALE,
					AMT_SALE,
					NO_POS,
					CD_DAMDANG
				        )
			VALUES
				        (
					@CD_STORE,
					@DS_LOCK,
					@NO_LOCK,
					@CD_MENU,
					@SEQ,
					@DS_SALE,
					@PR_SALE,
					@QTY_SALE,
					@AMT_SALE,
					@NO_POS,
					@CD_DAMDANG
				        )

		UPDATE SL_ORDER_H SET AMT_SALE = AMT_SALE + (@QTY_SALE * @PR_SALE)
		WHERE CD_STORE	=@CD_STORE
		      AND DS_LOCK	=@DS_LOCK
		      AND NO_LOCK	=@NO_LOCK


END
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO


if not exists(select * from information_schema.columns where TABLE_NAME='ms_menu' and COLUMN_NAME='yn_damdang')
BEGIN
ALTER TABLE ms_menu
ADD yn_damdang varchar(1)
END
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[SAVE_MS_MENU]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[SAVE_MS_MENU]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO






CREATE  PROCEDURE SAVE_MS_MENU

	@CD_STORE 	    		VARCHAR(4),
	@CD_MENU      		VARCHAR(14),
	@NM_MENU		    	VARCHAR(50),
	@NM_MENU_SHORT	    	VARCHAR(50),
	@DS_MENU_TYPE    		VARCHAR(1),
	@DS_GENDER			VARCHAR(1),
	@CD_UPJANG			VARCHAR(4),
	@PR_WONGA			INTEGER,
	@PR_SALE     			INTEGER,
	@DS_TAX 	    		VARCHAR(1),
	@YN_DC			VARCHAR(1),
	@YN_POINT			VARCHAR(1),
	@CD_CLASS 	    		VARCHAR(8),
	@YN_USE			VARCHAR(1),
	@DS_STOCK			VARCHAR(1),
	@STOCK_CLASS		VARCHAR(3),
	@NM_UNIT			VARCHAR(30),
	@CD_TRDPL			VARCHAR(6),
	@PR_BUY			INT,
	@QTY_SAFETY		INT,
	@CD_SAWON_CHG   		VARCHAR(6),
	@YN_DAMDANG		VARCHAR(1),
	@I_SW           			CHAR(1)
AS
BEGIN
    DECLARE @CNT INT

    IF @I_SW = 0
    BEGIN
		INSERT INTO  MS_MENU (	CD_STORE, 	 
						CD_MENU,     
						CD_CLASS, 	
						CD_UPJANG, 
						NM_MENU,	
						NM_MENU_SHORT,	 
						DS_MENU_TYPE,
						DS_GENDER,
						PR_WONGA,	
						PR_SALE,     
						DS_TAX, 	
						YN_DC,    
						YN_POINT,
						DS_STOCK,
						STOCK_CLASS,
						NM_UNIT,
						CD_TRDPL,
						PR_BUY,
						QTY_SAFETY,
						YN_USE,		
						CD_SAWON_CHG,
						YN_DAMDANG
						)

                       		 	VALUES(	@CD_STORE, 	 
						@CD_MENU,     
						@CD_CLASS, 	 
						@CD_UPJANG,
						@NM_MENU,		
						@NM_MENU_SHORT, 
						@DS_MENU_TYPE,
						@DS_GENDER,
						@PR_WONGA,	
						@PR_SALE,     
						@DS_TAX, 	   
						@YN_DC, 
						@YN_POINT,
						@DS_STOCK,
						@STOCK_CLASS,
						@NM_UNIT,
						@CD_TRDPL,
						@PR_BUY,
						@QTY_SAFETY,
						@YN_USE,		
						@CD_SAWON_CHG,
						@YN_DAMDANG
						)			

    END
    ELSE 
    BEGIN
		UPDATE  MS_MENU     SET 
						CD_CLASS		=@CD_CLASS, 	 
						CD_UPJANG		=@CD_UPJANG,
						NM_MENU		=@NM_MENU, 
						NM_MENU_SHORT        =@NM_MENU_SHORT,						
						DS_MENU_TYPE	=@DS_MENU_TYPE,
						DS_GENDER		=@DS_GENDER,
						PR_WONGA		=@PR_WONGA,
						PR_SALE		=@PR_SALE,     
						DS_TAX 		=@DS_TAX,    
						YN_DC			=@YN_DC,
						YN_POINT		=@YN_POINT,
						DS_STOCK		=@DS_STOCK,
						STOCK_CLASS		=@STOCK_CLASS,
						NM_UNIT		=@NM_UNIT,
						CD_TRDPL		=@CD_TRDPL,
						PR_BUY		=@PR_BUY,
						QTY_SAFETY		=@QTY_SAFETY,
						YN_USE		=@YN_USE,
						CD_SAWON_CHG	=@CD_SAWON_CHG,
						YN_DAMDANG		=@YN_DAMDANG,
						DT_CHANGE          	=GETDATE()
				WHERE    CD_STORE 		= @CD_STORE 
				      AND    CD_MENU 		= @CD_MENU


    END
    

	
END
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
if not exists(select * from information_schema.columns where TABLE_NAME='sl_sale_d' and COLUMN_NAME='dc_tot')
BEGIN
ALTER TABLE sl_sale_d
DROP COLUMN dc_tot 
END
GO

if not exists(select * from information_schema.columns where TABLE_NAME='sl_sale_d' and COLUMN_NAME='dc_spc')
BEGIN
EXEC sp_unbindefault 'sl_sale_d.dc_spc'
ALTER TABLE sl_sale_d
DROP COLUMN dc_spc 
END
GO

if not exists(select * from information_schema.columns where TABLE_NAME='sl_sale_d' and COLUMN_NAME='no_spc')
BEGIN
EXEC sp_unbindefault 'sl_sale_d.no_spc'
ALTER TABLE sl_sale_d
DROP COLUMN no_spc 
END
GO

if not exists(select * from information_schema.columns where TABLE_NAME='sl_sale_d' and COLUMN_NAME='dc_member')
BEGIN
ALTER TABLE sl_sale_d
add dc_member int 
END
GO

if not exists(select * from information_schema.columns where TABLE_NAME='sl_sale_d' and COLUMN_NAME='dc_tot')
BEGIN
ALTER TABLE sl_sale_d
add dc_tot as dc_menu + dc_receipt + dc_member 
END
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[POS_SAVE_SALE_D]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[POS_SAVE_SALE_D]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO

CREATE  PROCEDURE POS_SAVE_SALE_D

	@CD_STORE 	    		VARCHAR(4),
	@YMD_SALE			VARCHAR(8),
	@NO_POS			VARCHAR(2),
	@NO_RCP			VARCHAR(4),
	@DS_SALE			VARCHAR(1),
	@CD_MENU			VARCHAR(14),
	@SEQ				INT,
	@QTY_SALE			INT,
	@PR_SALE			INT,
	@AMT_SALE			INT,
	@DC_MENU			INT,
	@DC_RECEIPT			INT,
	@DC_MEMBER			INT,
	@AMT_VAT			INT,
	@DS_TAX			VARCHAR(1),
	@CD_DAMDANG		VARCHAR(6)
AS
BEGIN

	SELECT @SEQ = ISNULL(MAX(SEQ),0) + 1 FROM SL_SALE_D 
	WHERE CD_STORE 	=@CD_STORE 
	      AND YMD_SALE	=@YMD_SALE
	      AND NO_POS	=@NO_POS
	      AND NO_RCP	=@NO_RCP

	INSERT INTO SL_SALE_D(
					CD_STORE,
					YMD_SALE,
					NO_POS,
					NO_RCP,
					DS_SALE,
					CD_MENU,
					SEQ,
					QTY_SALE,	
					PR_SALE,
					AMT_SALE,
					DC_MENU,
					DC_RECEIPT,
                                        DC_MEMBER,
					AMT_VAT,		
					DS_TAX,
					CD_DAMDANG
					)
				VALUES
					(
					@CD_STORE,
					@YMD_SALE,
					@NO_POS,
					@NO_RCP,
					@DS_SALE,
					@CD_MENU,
					@SEQ,
					@QTY_SALE,
					@PR_SALE,
					@AMT_SALE,
					@DC_MENU,
					@DC_RECEIPT,
                                        @DC_MEMBER,
					@AMT_VAT,
					@DS_TAX,
					@CD_DAMDANG
					)
	

END
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[POS_SAVE_ORDER_C]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[POS_SAVE_ORDER_C]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO

-- 주문취소내역 저장
CREATE  PROCEDURE POS_SAVE_ORDER_C

	@CD_STORE 	    		VARCHAR(4),
	@YMD_SALE			VARCHAR(8),
	@NO_LOCK			VARCHAR(4),
	@DS_LOCK			VARCHAR(3),
	@CD_MENU			VARCHAR(14),
	@QTY_CANCEL		INT,
	@PR_SALE			INT,
	@AMT_SALE			INT,
	@NO_POS			VARCHAR(2),
	@CD_SAWON			VARCHAR(6),
	@CD_DAMDANG		VARCHAR(6)
AS
BEGIN

	DECLARE @SEQ INT

	IF @NO_LOCK	<> ''
	BEGIN

		SELECT @SEQ = ISNULL( MAX(SEQ), 0 ) + 1
		   FROM SL_ORDER_D
		WHERE CD_STORE	=@CD_STORE
		      AND DS_LOCK	=@DS_LOCK
		      AND NO_LOCK	=@NO_LOCK
	
		IF @SEQ IS NULL SET @SEQ = 1
	
		INSERT INTO SL_ORDER_D(
						CD_STORE,
						DS_LOCK,
						NO_LOCK,
						CD_MENU,
						SEQ,	
						QTY_SALE,
						PR_SALE,
						AMT_SALE,
						NO_POS,
						CD_DAMDANG
					         )
				VALUES
					        (
						@CD_STORE,
						@DS_LOCK,
						@NO_LOCK,
						@CD_MENU,
						@SEQ,
						@QTY_CANCEL*-1,
						@PR_SALE,
						@AMT_SALE,
						@NO_POS,
						@CD_DAMDANG
					        )

		UPDATE SL_ORDER_H SET AMT_SALE = AMT_SALE - (@QTY_CANCEL * @PR_SALE)
		WHERE CD_STORE	=@CD_STORE
		      AND DS_LOCK	=@DS_LOCK
		      AND NO_LOCK	=@NO_LOCK

		SELECT @SEQ = ISNULL( MAX(SEQ), 0 ) + 1
		   FROM SL_ORDER_C
		WHERE CD_STORE	=@CD_STORE
		      AND DS_LOCK	=@DS_LOCK
		      AND NO_LOCK	=@NO_LOCK
	
		IF @SEQ IS NULL SET @SEQ = 1
	
		INSERT INTO SL_ORDER_C(
						CD_STORE,
						DS_LOCK,
						NO_LOCK,
						SEQ,	
						CD_MENU,
						QTY_CANCEL,
						NO_POS,
						CD_SAWON
					         )
				VALUES
					        (
						@CD_STORE,
						@DS_LOCK,
						@NO_LOCK,
						@SEQ,
						@CD_MENU,
						@QTY_CANCEL,
						@NO_POS,
						@CD_SAWON
					        )
	END
	ELSE IF LEN(@YMD_SALE) <> 8
	BEGIN
		SELECT @SEQ = ISNULL( MAX(SEQ), 0 ) + 1
		   FROM SL_SALE_C
		WHERE CD_STORE	=@CD_STORE
		      AND YMD_SALE	=@YMD_SALE
	
		IF @SEQ IS NULL SET @SEQ = 1
	
		INSERT INTO SL_SALE_C(
						CD_STORE,
						YMD_SALE,
						SEQ,	
						DS_LOCK,
						NO_LOCK,
						CD_MENU,
						QTY_CANCEL,
						NO_POS,
						CD_SAWON
					         )
				VALUES
					        (
						@CD_STORE,
						@YMD_SALE,
						@SEQ,
						@DS_LOCK,
						@NO_LOCK,
						@CD_MENU,
						@QTY_CANCEL,
						@NO_POS,
						@CD_SAWON
					        )
	END

END
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO


if not exists(select * from information_schema.columns where TABLE_NAME='ms_goods' and COLUMN_NAME='cd_menu2')
BEGIN
ALTER TABLE ms_goods
ADD cd_menu2 varchar(14)
END
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[SAVE_MS_GOODS]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[SAVE_MS_GOODS]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO


CREATE  PROCEDURE SAVE_MS_GOODS

	@CD_STORE 	    		VARCHAR(4),
	@CD_GOODS      		VARCHAR(4),
	@NM_GOODS		    	VARCHAR(50),
	@PR_SALE		    	INT,
	@CD_MENU	    		VARCHAR(14),
	@CD_MENU2			VARCHAR(14),
	@ALLOW_PERIOD		INTEGER,
	@ALLOW_TOTCNT		INTEGER,
	@ALLOW_DAYCNT		INTEGER,
	@DS_STATUS			INTEGER,
	@CD_SAWON_CHG   		VARCHAR(6),
	@I_SW           			CHAR(1)
AS
BEGIN

    IF @I_SW = 0
    BEGIN
		INSERT INTO  MS_GOODS (	CD_STORE, 	 
						CD_GOODS,     
						NM_GOODS, 	
						PR_SALE, 
						CD_MENU,	
						CD_MENU2,
						ALLOW_PERIOD,	 
						ALLOW_TOTCNT,
						ALLOW_DAYCNT,	
						CD_SAWON_CHG,     
						DS_STATUS
						)

                       		 	VALUES(	@CD_STORE,
						@CD_GOODS,     
						@NM_GOODS, 	
						@PR_SALE, 
						@CD_MENU,	
						@CD_MENU2,
						@ALLOW_PERIOD,	 
						@ALLOW_TOTCNT,
						@ALLOW_DAYCNT,	
						@CD_SAWON_CHG,     
						@DS_STATUS
						)			

    END
    ELSE 
    BEGIN
		UPDATE  MS_GOODS     SET 
						CD_GOODS		=@CD_GOODS,
						NM_GOODS		=@NM_GOODS,
						PR_SALE		=@PR_SALE,
						CD_MENU		=@CD_MENU,
						CD_MENU2		=@CD_MENU2,
						ALLOW_PERIOD	=@ALLOW_PERIOD,
						ALLOW_TOTCNT	=@ALLOW_TOTCNT,
						ALLOW_DAYCNT	=@ALLOW_DAYCNT,
						CD_SAWON_CHG	=@CD_SAWON_CHG,
						DT_CHANGE          	=GETDATE()
				WHERE    CD_STORE 		= @CD_STORE 
				      AND    CD_GOODS 		= @CD_GOODS


    END
    

	
END
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

