IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'irisdb')
CREATE USER [irisdb] FOR LOGIN [irisdb] WITH DEFAULT_SCHEMA=[dbo]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GP_SERVER_EVENT]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'

/**********************************************************************
 *<
	FILE: GP_SERVER_EVENT.SQL

	DESCRIPTION: 서비 이벤트

	CREATED BY: 곽철중

	HISTORY: Created 01/17/07

 *>	Copyright (c) 2007, All Rights Reserved.
 **********************************************************************/

CREATE PROCEDURE [dbo].[GP_SERVER_EVENT]
	(@REGISTER_DATE datetime		--등록날짜
	,@SOURCE		[varchar](50)	--원본
	,@MESSAGE		[text]			--메시지
	,@COMPUTER      [varchar](132))	--컴퓨터

AS

SET NOCOUNT ON -- 영향받은 행의 갯수를 반환하지 않는다.

INSERT INTO [dbo].[TB_SERVER_EVENT] 
	([REGISTER_DATE]
	,[SOURCE]
	,[MESSAGE]
	,[COMPUTER]) 

VALUES 
	(@REGISTER_DATE
	,@SOURCE
	,@MESSAGE
	,@COMPUTER)

/* 확인검사 안함
IF @@ROWCOUNT = 0
	BEGIN
	END
ELSE
	BEGIN
	END
*/


' 
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TB_GUILD_EVENT]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[TB_GUILD_EVENT](
	[IDX] [int] IDENTITY(1,1) NOT NULL,
	[REGISTER_DATE] [datetime] NOT NULL CONSTRAINT [DF_TB_GUILD_EVENT_REGISTER_DATE]  DEFAULT (getdate()),
	[SERVER_IDX] [int] NOT NULL,
	[CHARACTER_IDX] [int] NOT NULL,
	[GUILD_IDX] [int] NOT NULL,
	[GUILD_POSITION] [tinyint] NOT NULL,
	[MESSAGE] [text] NOT NULL,
	[COMPUTER] [varchar](132) NOT NULL,
 CONSTRAINT [PK_TB_GUILD_EVENT] PRIMARY KEY CLUSTERED 
(
	[IDX] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'캐릭터 인덱스' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_GUILD_EVENT', @level2type=N'COLUMN', @level2name=N'CHARACTER_IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'길드인덱스' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_GUILD_EVENT', @level2type=N'COLUMN', @level2name=N'GUILD_IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'길드직위' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_GUILD_EVENT', @level2type=N'COLUMN', @level2name=N'GUILD_POSITION'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'메시지' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_GUILD_EVENT', @level2type=N'COLUMN', @level2name=N'MESSAGE'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'컴퓨터' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_GUILD_EVENT', @level2type=N'COLUMN', @level2name=N'COMPUTER'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TB_SERVER_EVENT]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[TB_SERVER_EVENT](
	[IDX] [int] IDENTITY(1,1) NOT NULL,
	[REGISTER_DATE] [datetime] NOT NULL CONSTRAINT [DF_TB_SERVER_EVENT_REGISTER_DATE]  DEFAULT (getdate()),
	[SOURCE] [varchar](50) NOT NULL,
	[MESSAGE] [ntext] NOT NULL,
	[COMPUTER] [varchar](132) NOT NULL,
 CONSTRAINT [PK_TB_SERVER_EVENT] PRIMARY KEY CLUSTERED 
(
	[IDX] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'고유번호' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_SERVER_EVENT', @level2type=N'COLUMN', @level2name=N'IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'등록일' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_SERVER_EVENT', @level2type=N'COLUMN', @level2name=N'REGISTER_DATE'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'원본' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_SERVER_EVENT', @level2type=N'COLUMN', @level2name=N'SOURCE'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'메시지' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_SERVER_EVENT', @level2type=N'COLUMN', @level2name=N'MESSAGE'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'컴퓨터' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_SERVER_EVENT', @level2type=N'COLUMN', @level2name=N'COMPUTER'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TB_MEMBER_EVENT]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[TB_MEMBER_EVENT](
	[IDX] [int] IDENTITY(1,1) NOT NULL,
	[REGISTER_DATE] [datetime] NOT NULL CONSTRAINT [DF_TB_MEMBER_EVENT_REGISTER_DATE]  DEFAULT (getdate()),
	[TYPE] [varchar](50) NOT NULL,
	[SOURCE] [varchar](50) NOT NULL,
	[CATEGORY] [varchar](50) NOT NULL,
	[MEMBER_IDX] [int] NOT NULL,
	[MESSAGE] [text] NULL,
	[COMPUTER] [varchar](132) NOT NULL,
 CONSTRAINT [PK_TB_MEMBER_EVENT] PRIMARY KEY CLUSTERED 
(
	[IDX] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'고유번호' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_MEMBER_EVENT', @level2type=N'COLUMN', @level2name=N'IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'등록일' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_MEMBER_EVENT', @level2type=N'COLUMN', @level2name=N'REGISTER_DATE'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'종류(성공감사/실패감사)' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_MEMBER_EVENT', @level2type=N'COLUMN', @level2name=N'TYPE'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'원본' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_MEMBER_EVENT', @level2type=N'COLUMN', @level2name=N'SOURCE'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'범주(로그온/로그오프)' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_MEMBER_EVENT', @level2type=N'COLUMN', @level2name=N'CATEGORY'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'회원 고유번호' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_MEMBER_EVENT', @level2type=N'COLUMN', @level2name=N'MEMBER_IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'메시지' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_MEMBER_EVENT', @level2type=N'COLUMN', @level2name=N'MESSAGE'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'컴퓨터' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_MEMBER_EVENT', @level2type=N'COLUMN', @level2name=N'COMPUTER'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TB_MONEY_EVENT]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[TB_MONEY_EVENT](
	[IDX] [int] IDENTITY(1,1) NOT NULL,
	[REGISTER_DATE] [datetime] NOT NULL CONSTRAINT [DF_TB_MONEY_EVENT_REGISTER_DATE]  DEFAULT (getdate()),
	[SERVER_IDX] [int] NOT NULL,
	[CHARACTER_IDX] [int] NOT NULL,
	[BEFORE] [int] NOT NULL,
	[AFTER] [int] NOT NULL,
	[MESSAGE] [text] NULL,
	[COMPUTER] [varchar](132) NOT NULL,
 CONSTRAINT [PK_TB_MONEY_EVENT] PRIMARY KEY CLUSTERED 
(
	[IDX] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'고유번호(인덱스)' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_MONEY_EVENT', @level2type=N'COLUMN', @level2name=N'IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'등록일' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_MONEY_EVENT', @level2type=N'COLUMN', @level2name=N'REGISTER_DATE'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'서버 고유번호(인덱스)' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_MONEY_EVENT', @level2type=N'COLUMN', @level2name=N'SERVER_IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'캐릭터 고유번호(인덱스)' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_MONEY_EVENT', @level2type=N'COLUMN', @level2name=N'CHARACTER_IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'변경전 금액' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_MONEY_EVENT', @level2type=N'COLUMN', @level2name=N'BEFORE'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'변경후 금액' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_MONEY_EVENT', @level2type=N'COLUMN', @level2name=N'AFTER'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'메시지' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_MONEY_EVENT', @level2type=N'COLUMN', @level2name=N'MESSAGE'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'컴퓨터' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_MONEY_EVENT', @level2type=N'COLUMN', @level2name=N'COMPUTER'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TB_CHARACTER_EVENT]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[TB_CHARACTER_EVENT](
	[IDX] [int] IDENTITY(1,1) NOT NULL,
	[REGISTER_DATE] [datetime] NOT NULL CONSTRAINT [DF_TB_CHARACTER_EVENT_REGISTER_DATE]  DEFAULT (getdate()),
	[CATEGORY] [varchar](50) NOT NULL,
	[MEMBER_IDX] [int] NOT NULL,
	[SERVER_IDX] [int] NOT NULL,
	[CHARACTER_IDX] [int] NOT NULL,
	[MESSAGE] [text] NOT NULL,
	[COMPUTER] [varchar](132) NOT NULL,
 CONSTRAINT [PK_TB_CHARACTER_EVENT] PRIMARY KEY CLUSTERED 
(
	[IDX] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'고유번호' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_CHARACTER_EVENT', @level2type=N'COLUMN', @level2name=N'IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'등록일' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_CHARACTER_EVENT', @level2type=N'COLUMN', @level2name=N'REGISTER_DATE'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'범주(생성/삭제/변경)' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_CHARACTER_EVENT', @level2type=N'COLUMN', @level2name=N'CATEGORY'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'회원 고유번호' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_CHARACTER_EVENT', @level2type=N'COLUMN', @level2name=N'MEMBER_IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'서버 고유번호' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_CHARACTER_EVENT', @level2type=N'COLUMN', @level2name=N'SERVER_IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'캐릭터 고유번호' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_CHARACTER_EVENT', @level2type=N'COLUMN', @level2name=N'CHARACTER_IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'메시지' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_CHARACTER_EVENT', @level2type=N'COLUMN', @level2name=N'MESSAGE'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'컴퓨터' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_CHARACTER_EVENT', @level2type=N'COLUMN', @level2name=N'COMPUTER'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TB_CONCURRENT_EVENT]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[TB_CONCURRENT_EVENT](
	[IDX] [int] IDENTITY(1,1) NOT NULL,
	[REGISTER_DATE] [datetime] NOT NULL CONSTRAINT [DF_TB_CONCURRENT_EVENT_REGISTER_DATE]  DEFAULT (getdate()),
	[SERVER_IDX] [int] NOT NULL,
	[MINIMUM] [int] NOT NULL,
	[MAXIMUM] [int] NOT NULL,
	[MESSAGE] [text] NOT NULL,
	[COMPUTER] [varchar](132) NOT NULL,
 CONSTRAINT [PK_TB_CONCURRENT_EVENT] PRIMARY KEY CLUSTERED 
(
	[IDX] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'고유번호' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_CONCURRENT_EVENT', @level2type=N'COLUMN', @level2name=N'IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'등록일' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_CONCURRENT_EVENT', @level2type=N'COLUMN', @level2name=N'REGISTER_DATE'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'서버 고유번호(인덱스)' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_CONCURRENT_EVENT', @level2type=N'COLUMN', @level2name=N'SERVER_IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'최소 동시접속(수)' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_CONCURRENT_EVENT', @level2type=N'COLUMN', @level2name=N'MINIMUM'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'최대 동시접속(수)' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_CONCURRENT_EVENT', @level2type=N'COLUMN', @level2name=N'MAXIMUM'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'메시지' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_CONCURRENT_EVENT', @level2type=N'COLUMN', @level2name=N'MESSAGE'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'컴퓨터' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_CONCURRENT_EVENT', @level2type=N'COLUMN', @level2name=N'COMPUTER'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TB_DEPOSIT_EVENT]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[TB_DEPOSIT_EVENT](
	[IDX] [int] IDENTITY(1,1) NOT NULL,
	[REGISTER_DATE] [datetime] NOT NULL CONSTRAINT [DF_TB_DEPOSIT_EVENT_REGISTER_DATE]  DEFAULT (getdate()),
	[SERVER_IDX] [int] NOT NULL,
	[CHARACTER_IDX] [int] NOT NULL,
	[BEFORE] [int] NOT NULL,
	[AFTER] [int] NOT NULL,
	[MESSAGE] [text] NOT NULL,
	[COMPUTER] [varchar](132) NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'고유번호' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_DEPOSIT_EVENT', @level2type=N'COLUMN', @level2name=N'IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'등록일' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_DEPOSIT_EVENT', @level2type=N'COLUMN', @level2name=N'REGISTER_DATE'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TB_QUEST_EVENT]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[TB_QUEST_EVENT](
	[IDX] [int] IDENTITY(1,1) NOT NULL,
	[REGISTER_DATE] [datetime] NOT NULL CONSTRAINT [DF_TB_QUEST_EVENT_REGISTER_DATE]  DEFAULT (getdate()),
	[SERVER_IDX] [int] NOT NULL,
	[CATEGORY] [varchar](50) NOT NULL,
	[CHARACTER_IDX] [int] NOT NULL,
	[QUEST_IDX] [int] NOT NULL,
	[MESSAGE] [text] NOT NULL,
	[COMPUTER] [varchar](132) NOT NULL,
 CONSTRAINT [PK_TB_QUEST_EVENT] PRIMARY KEY CLUSTERED 
(
	[IDX] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'고유번호' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_QUEST_EVENT', @level2type=N'COLUMN', @level2name=N'IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'등록일' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_QUEST_EVENT', @level2type=N'COLUMN', @level2name=N'REGISTER_DATE'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'서버 고유번호(인덱스)' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_QUEST_EVENT', @level2type=N'COLUMN', @level2name=N'SERVER_IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'범주' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_QUEST_EVENT', @level2type=N'COLUMN', @level2name=N'CATEGORY'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'캐릭터 고유번호' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_QUEST_EVENT', @level2type=N'COLUMN', @level2name=N'CHARACTER_IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'퀘스트 고유번호' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_QUEST_EVENT', @level2type=N'COLUMN', @level2name=N'QUEST_IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'메시지' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_QUEST_EVENT', @level2type=N'COLUMN', @level2name=N'MESSAGE'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'컴퓨터' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_QUEST_EVENT', @level2type=N'COLUMN', @level2name=N'COMPUTER'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TB_INVENTORY_EVENT]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[TB_INVENTORY_EVENT](
	[IDX] [int] IDENTITY(1,1) NOT NULL,
	[REGISTER_DATE] [datetime] NOT NULL CONSTRAINT [DF_TB_INVENTORY_EVENT_REGISTER_DATE]  DEFAULT (getdate()),
	[SERVER_IDX] [int] NOT NULL,
	[CATEGORY] [varchar](50) NOT NULL,
	[INVENTORY_IDX] [int] NOT NULL,
	[CHARACTER_IDX] [int] NOT NULL,
	[ITEM_DEFINE_INDEX] [int] NOT NULL,
	[COUNT] [smallint] NOT NULL,
	[ENHANCED] [tinyint] NOT NULL,
	[SEAL] [tinyint] NOT NULL,
	[MESSAGE] [text] NULL,
	[COMPUTER] [varchar](132) NOT NULL,
 CONSTRAINT [PK_TB_INVENTORY_EVENT] PRIMARY KEY CLUSTERED 
(
	[IDX] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'고유번호' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_INVENTORY_EVENT', @level2type=N'COLUMN', @level2name=N'IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'등록일' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_INVENTORY_EVENT', @level2type=N'COLUMN', @level2name=N'REGISTER_DATE'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'서버 고유번호' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_INVENTORY_EVENT', @level2type=N'COLUMN', @level2name=N'SERVER_IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'범주(생성/삭제/변경)' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_INVENTORY_EVENT', @level2type=N'COLUMN', @level2name=N'CATEGORY'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'인벤토리 고유번호' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_INVENTORY_EVENT', @level2type=N'COLUMN', @level2name=N'INVENTORY_IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'캐릭터 고유번호(소유주)' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_INVENTORY_EVENT', @level2type=N'COLUMN', @level2name=N'CHARACTER_IDX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'아이템 정의 인덱스' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_INVENTORY_EVENT', @level2type=N'COLUMN', @level2name=N'ITEM_DEFINE_INDEX'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'보유수량' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_INVENTORY_EVENT', @level2type=N'COLUMN', @level2name=N'COUNT'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'강화단계' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_INVENTORY_EVENT', @level2type=N'COLUMN', @level2name=N'ENHANCED'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'봉인여부' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_INVENTORY_EVENT', @level2type=N'COLUMN', @level2name=N'SEAL'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'메시지' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_INVENTORY_EVENT', @level2type=N'COLUMN', @level2name=N'MESSAGE'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'컴퓨터' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'TB_INVENTORY_EVENT', @level2type=N'COLUMN', @level2name=N'COMPUTER'

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GP_GUILD_EVENT]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'

/**********************************************************************
 *<
	FILE: GP_GUILD_EVENT.SQL

	DESCRIPTION: 길드 이벤트

	CREATED BY: 김가람

	HISTORY: 

 *>	Copyright (c) 2008, All Rights Reserved.
 **********************************************************************/

CREATE PROCEDURE [dbo].[GP_GUILD_EVENT]
	(@REGISTER_DATE datetime		--등록날짜
	,@SERVER_IDX	[int]			--서  버 테이블의 고유번호
	,@CHARACTER_IDX	[int]			--캐릭터 테이블의 고유번호
	,@GUILD_IDX		[int]			--길  드 테이블의 고유번호
	,@GUILD_POS		[tinyint]		--길  드 테이블의 직위
	,@MESSAGE		[text]			--메시지
	,@COMPUTER      [varchar](132))	--컴퓨터

AS

SET NOCOUNT ON -- 영향받은 행의 갯수를 반환하지 않는다.

INSERT INTO [dbo].[TB_GUILD_EVENT] 
	 ([REGISTER_DATE]
	 ,[SERVER_IDX]
	 ,[CHARACTER_IDX]
	 ,[GUILD_IDX]
	 ,[GUILD_POSITION]
	 ,[MESSAGE]
	 ,[COMPUTER])

VALUES 
	(@REGISTER_DATE
	,@SERVER_IDX
	,@CHARACTER_IDX
	,@GUILD_IDX
	,@GUILD_POS
	,@MESSAGE
	,@COMPUTER)

/* 확인검사 안함
IF @@ROWCOUNT = 0
	BEGIN
	END
ELSE
	BEGIN
	END
*/

' 
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GP_MEMBER_EVENT]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'
/**********************************************************************
 *<
	FILE: GP_MEMBER_EVENT.SQL

	DESCRIPTION: 서비 이벤트

	CREATED BY: 곽철중

	HISTORY: Created 01/17/07

 *>	Copyright (c) 2007, All Rights Reserved.
 **********************************************************************/

CREATE PROCEDURE [dbo].[GP_MEMBER_EVENT]
	(@REGISTER_DATE datetime		--등록날짜
	,@TYPE          [varchar](50)   --종류
	,@SOURCE		[varchar](50)	--원본
	,@CATEGOTY      [varchar](50)   --범주
	,@MEMBER_IDX    [int]			--회원 테이블의 고유번호
	,@MESSAGE		[text]			--메시지
	,@COMPUTER      [varchar](132))	--컴퓨터

AS

SET NOCOUNT ON -- 영향받은 행의 갯수를 반환하지 않는다.

INSERT INTO [dbo].[TB_MEMBER_EVENT] 
	([REGISTER_DATE]
	,[TYPE]
	,[SOURCE]
	,[CATEGORY]
	,[MEMBER_IDX]
	,[MESSAGE]
	,[COMPUTER])

VALUES 
	(@REGISTER_DATE
	,@TYPE
	,@SOURCE
	,@CATEGOTY
	,@MEMBER_IDX
	,@MESSAGE
	,@COMPUTER)

/* 확인검사 안함
IF @@ROWCOUNT = 0
	BEGIN
	END
ELSE
	BEGIN
	END
*/

' 
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GP_MONEY_EVENT]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'

/**********************************************************************
 *<
	FILE: GP_MONEY_EVENT.SQL

	DESCRIPTION: MONEY(금액) 이벤트

	CREATED BY: 곽철중

	HISTORY: Created 05/18/07

 *>	Copyright (c) 2007, All Rights Reserved.
 **********************************************************************/

CREATE PROCEDURE [dbo].[GP_MONEY_EVENT]
	(@REGISTER_DATE datetime		--등록날짜
	,@SERVER_IDX    [int]			--서  버 고유번호(인덱스)
	,@CHARACTER_IDX	[int]			--캐릭터 고유번호(인덱스)
	,@BEFORE		[int]			--변경전 금액
	,@AFTER			[int]			--변경후 금액
	,@MESSAGE		[text]			--메시지
	,@COMPUTER      [varchar](132))	--컴퓨터

AS

SET NOCOUNT ON -- 영향받은 행의 갯수를 반환하지 않는다.

INSERT INTO [dbo].[TB_MONEY_EVENT] 
	([REGISTER_DATE]
	,[SERVER_IDX]
	,[CHARACTER_IDX]
	,[BEFORE]
	,[AFTER]
	,[MESSAGE]
	,[COMPUTER])

VALUES
	(@REGISTER_DATE
	,@SERVER_IDX
	,@CHARACTER_IDX
	,@BEFORE
	,@AFTER
	,@MESSAGE
	,@COMPUTER)



' 
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GP_CHARACTER_EVENT]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'
/**********************************************************************
 *<
	FILE: GP_CHARACTER_EVENT.SQL

	DESCRIPTION: 캐릭터 이벤트

	CREATED BY: 곽철중

	HISTORY: Created 06/29/07

 *>	Copyright (c) 2007, All Rights Reserved.
 **********************************************************************/

CREATE PROCEDURE [dbo].[GP_CHARACTER_EVENT]
	(@REGISTER_DATE datetime		--등록날짜
	,@CATEGOTY      [varchar](50)   --범  주 생성/삭제/수정
	,@MEMBER_IDX    [int]			--회  원 테이블의 고유번호
	,@SERVER_IDX	[int]			--서  버 테이블의 고유번호
	,@CHARACTER_IDX	[int]			--캐릭터 테이블의 고유번호
	,@MESSAGE		[text]			--메시지
	,@COMPUTER      [varchar](132))	--컴퓨터

AS

SET NOCOUNT ON -- 영향받은 행의 갯수를 반환하지 않는다.

INSERT INTO [dbo].[TB_CHARACTER_EVENT] 
	([REGISTER_DATE]
	,[CATEGORY]
	,[MEMBER_IDX]
	,[SERVER_IDX]
	,[CHARACTER_IDX]
	,[MESSAGE]
	,[COMPUTER])

VALUES 
	(@REGISTER_DATE
	,@CATEGOTY
	,@MEMBER_IDX
	,@SERVER_IDX
	,@CHARACTER_IDX
	,@MESSAGE
	,@COMPUTER)

/* 확인검사 안함
IF @@ROWCOUNT = 0
	BEGIN
	END
ELSE
	BEGIN
	END
*/
' 
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GP_CONCURRENT_EVENT]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'
/**********************************************************************
 *<
	FILE: GP_CONCURRENT_EVENT.SQL

	DESCRIPTION: CON CURRENT 이벤트

	CREATED BY: 곽철중

	HISTORY: Created 02/04/08

 *>	Copyright (c) 2008, All Rights Reserved.
 **********************************************************************/

CREATE PROCEDURE [dbo].[GP_CONCURRENT_EVENT]
	(@REGISTER_DATE datetime		--등록날짜
	,@SERVER_IDX    [int]			--서  버 고유번호(인덱스)
	,@MINIMUM		[int]			--최소 동시접속 (수)
	,@MAXIMUM		[int]			--최대 동시접속 (수)
	,@MESSAGE		[text]			--메시지
	,@COMPUTER      [varchar](132))	--컴퓨터

AS

SET NOCOUNT ON -- 영향받은 행의 갯수를 반환하지 않는다.

INSERT INTO [dbo].[TB_CONCURRENT_EVENT] 
	([REGISTER_DATE]
	,[SERVER_IDX]
	,[MINIMUM]
	,[MAXIMUM]
	,[MESSAGE]
	,[COMPUTER])

VALUES
	(@REGISTER_DATE
	,@SERVER_IDX
	,@MINIMUM
	,@MAXIMUM
	,@MESSAGE
	,@COMPUTER)
' 
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GP_DEPOSIT_EVENT]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'
/**********************************************************************
 *<
	FILE: GP_DEPOSIT_EVENT.SQL

	DESCRIPTION: DEPOSIT(예치금액) 이벤트

	CREATED BY: 곽철중

	HISTORY: Created 02/14/08

 *>	Copyright (c) 2008, All Rights Reserved.
 **********************************************************************/

CREATE PROCEDURE [dbo].[GP_DEPOSIT_EVENT]
	(@REGISTER_DATE datetime		--등록날짜
	,@SERVER_IDX    [int]			--서  버 고유번호(인덱스)
	,@CHARACTER_IDX	[int]			--캐릭터 고유번호(인덱스)
	,@BEFORE		[int]			--변경전 금액
	,@AFTER			[int]			--변경후 금액
	,@MESSAGE		[text]			--메시지
	,@COMPUTER      [varchar](132))	--컴퓨터

AS

SET NOCOUNT ON -- 영향받은 행의 갯수를 반환하지 않는다.

INSERT INTO [dbo].[TB_DEPOSIT_EVENT] 
	([REGISTER_DATE]
	,[SERVER_IDX]
	,[CHARACTER_IDX]
	,[BEFORE]
	,[AFTER]
	,[MESSAGE]
	,[COMPUTER])

VALUES
	(@REGISTER_DATE
	,@SERVER_IDX
	,@CHARACTER_IDX
	,@BEFORE
	,@AFTER
	,@MESSAGE
	,@COMPUTER)
' 
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GP_QUEST_EVENT]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'
/**********************************************************************
 *<
	FILE: GP_QUEST_EVENT.SQL

	DESCRIPTION: 캐릭터 이벤트

	CREATED BY: 곽철중

	HISTORY: Created 03/12/08

 *>	Copyright (c) 2008, All Rights Reserved.
 **********************************************************************/

CREATE PROCEDURE [dbo].[GP_QUEST_EVENT]
	(@REGISTER_DATE datetime		--등록날짜
	,@SERVER_IDX	[int]			--서  버 테이블의 고유번호
	,@CATEGOTY		[varchar](50)	--범  주 생성/삭제/수정
	,@CHARACTER_IDX	[int]			--캐릭터 테이블의 고유번호
	,@QUEST_IDX		[int]			--퀘스트 테이블의 고유번호
	,@MESSAGE		[text]			--메시지
	,@COMPUTER      [varchar](132))	--컴퓨터

AS

SET NOCOUNT ON -- 영향받은 행의 갯수를 반환하지 않는다.

INSERT INTO [dbo].[TB_QUEST_EVENT] 
	 ([REGISTER_DATE]
	 ,[SERVER_IDX]
	 ,[CATEGORY]
	 ,[CHARACTER_IDX]
	 ,[QUEST_IDX]
	 ,[MESSAGE]
	 ,[COMPUTER])

VALUES 
	(@REGISTER_DATE
	,@SERVER_IDX
	,@CATEGOTY
	,@CHARACTER_IDX
	,@QUEST_IDX
	,@MESSAGE
	,@COMPUTER)

/* 확인검사 안함
IF @@ROWCOUNT = 0
	BEGIN
	END
ELSE
	BEGIN
	END
*/
' 
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GP_INVENTORY_EVENT]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'

/**********************************************************************
 *<
	FILE: GP_INVENTORY_EVENT.SQL

	DESCRIPTION:

	CREATED BY: 곽철중

	HISTORY: Created 06/18/07

 *>	Copyright (c) 2007, All Rights Reserved.
 **********************************************************************/

CREATE PROCEDURE [dbo].[GP_INVENTORY_EVENT]
    (@REGISTER_DATE datetime		--등록날짜
	,@SERVER_IDX		[int]			--서버 고유번호
	,@CATEGORY			[varchar](50)	--범주
	,@INVENTORY_IDX		[int]			--인벤토리 고유번호
	,@CHARACTER_IDX		[int]			--캐릭터고유번호
	,@ITEM_DEFINE_INDEX	[int]			--아이템 정의 인덱스
	,@COUNT				[smallint]		--인벤토리 보유수량
	,@ENHANCED          [tinyint]		--인벤토리 강화단계
	,@SEAL				[tinyint]		--인벤토리 봉인여부
	,@MESSAGE			[text]			--메시지
	,@COMPUTER			[varchar](132))	--컴퓨터

AS

SET NOCOUNT ON -- 영향받은 행의 갯수를 반환하지 않는다.

INSERT INTO [dbo].[TB_INVENTORY_EVENT] 
	([REGISTER_DATE]
	,[SERVER_IDX]
	,[CATEGORY]
	,[INVENTORY_IDX]
	,[CHARACTER_IDX]
	,[ITEM_DEFINE_INDEX]
	,[COUNT]
	,[ENHANCED]
	,[SEAL]
	,[MESSAGE]
	,[COMPUTER])
VALUES
    (@REGISTER_DATE
	,@SERVER_IDX
	,@CATEGORY
	,@INVENTORY_IDX
	,@CHARACTER_IDX
	,@ITEM_DEFINE_INDEX
	,@COUNT
	,@ENHANCED
	,@SEAL
	,@MESSAGE
	,@COMPUTER)

' 
END
