USE [master]
GO
/****** Object:  Database [World00_GameLog]    Script Date: 12/20/2015 6:11:35 PM ******/
CREATE DATABASE [World00_GameLog]
 CONTAINMENT = NONE
 ON  PRIMARY 
( NAME = N'W00_Log', FILENAME = N'D:\SQL SERVER DATA\SQL Server\MSSQL12.SQLEXPRESS\MSSQL\DATA\World00_GameLog.mdf' , SIZE = 6144KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'W00_Log_log', FILENAME = N'D:\SQL SERVER DATA\SQL Server\MSSQL12.SQLEXPRESS\MSSQL\DATA\World00_GameLog_1.ldf' , SIZE = 26816KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
ALTER DATABASE [World00_GameLog] SET COMPATIBILITY_LEVEL = 100
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [World00_GameLog].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [World00_GameLog] SET ANSI_NULL_DEFAULT OFF 
GO
ALTER DATABASE [World00_GameLog] SET ANSI_NULLS OFF 
GO
ALTER DATABASE [World00_GameLog] SET ANSI_PADDING OFF 
GO
ALTER DATABASE [World00_GameLog] SET ANSI_WARNINGS OFF 
GO
ALTER DATABASE [World00_GameLog] SET ARITHABORT OFF 
GO
ALTER DATABASE [World00_GameLog] SET AUTO_CLOSE OFF 
GO
ALTER DATABASE [World00_GameLog] SET AUTO_SHRINK OFF 
GO
ALTER DATABASE [World00_GameLog] SET AUTO_UPDATE_STATISTICS ON 
GO
ALTER DATABASE [World00_GameLog] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO
ALTER DATABASE [World00_GameLog] SET CURSOR_DEFAULT  GLOBAL 
GO
ALTER DATABASE [World00_GameLog] SET CONCAT_NULL_YIELDS_NULL OFF 
GO
ALTER DATABASE [World00_GameLog] SET NUMERIC_ROUNDABORT OFF 
GO
ALTER DATABASE [World00_GameLog] SET QUOTED_IDENTIFIER OFF 
GO
ALTER DATABASE [World00_GameLog] SET RECURSIVE_TRIGGERS OFF 
GO
ALTER DATABASE [World00_GameLog] SET  DISABLE_BROKER 
GO
ALTER DATABASE [World00_GameLog] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO
ALTER DATABASE [World00_GameLog] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO
ALTER DATABASE [World00_GameLog] SET TRUSTWORTHY OFF 
GO
ALTER DATABASE [World00_GameLog] SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO
ALTER DATABASE [World00_GameLog] SET PARAMETERIZATION SIMPLE 
GO
ALTER DATABASE [World00_GameLog] SET READ_COMMITTED_SNAPSHOT OFF 
GO
ALTER DATABASE [World00_GameLog] SET HONOR_BROKER_PRIORITY OFF 
GO
ALTER DATABASE [World00_GameLog] SET RECOVERY FULL 
GO
ALTER DATABASE [World00_GameLog] SET  MULTI_USER 
GO
ALTER DATABASE [World00_GameLog] SET PAGE_VERIFY CHECKSUM  
GO
ALTER DATABASE [World00_GameLog] SET DB_CHAINING OFF 
GO
ALTER DATABASE [World00_GameLog] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF ) 
GO
ALTER DATABASE [World00_GameLog] SET TARGET_RECOVERY_TIME = 0 SECONDS 
GO
ALTER DATABASE [World00_GameLog] SET DELAYED_DURABILITY = DISABLED 
GO
USE [World00_GameLog]
GO
/****** Object:  User [Stormy-PC\Administrator]    Script Date: 12/20/2015 6:11:35 PM ******/
CREATE USER [Stormy-PC\Administrator] FOR LOGIN [Stormy-PC\Administrator] WITH DEFAULT_SCHEMA=[dbo]
GO
/****** Object:  User [si.zhong_query##$Z]    Script Date: 12/20/2015 6:11:36 PM ******/
CREATE USER [si.zhong_query##$Z] WITHOUT LOGIN WITH DEFAULT_SCHEMA=[dbo]
GO
/****** Object:  User [NT AUTHORITY\SYSTEM]    Script Date: 12/20/2015 6:11:36 PM ******/
CREATE USER [NT AUTHORITY\SYSTEM] FOR LOGIN [NT AUTHORITY\SYSTEM] WITH DEFAULT_SCHEMA=[dbo]
GO
/****** Object:  User [aCC_sel]    Script Date: 12/20/2015 6:11:36 PM ******/
CREATE USER [aCC_sel] WITHOUT LOGIN WITH DEFAULT_SCHEMA=[dbo]
GO
ALTER ROLE [db_owner] ADD MEMBER [Stormy-PC\Administrator]
GO
ALTER ROLE [db_accessadmin] ADD MEMBER [Stormy-PC\Administrator]
GO
ALTER ROLE [db_securityadmin] ADD MEMBER [Stormy-PC\Administrator]
GO
ALTER ROLE [db_ddladmin] ADD MEMBER [Stormy-PC\Administrator]
GO
ALTER ROLE [db_backupoperator] ADD MEMBER [Stormy-PC\Administrator]
GO
ALTER ROLE [db_datareader] ADD MEMBER [Stormy-PC\Administrator]
GO
ALTER ROLE [db_datawriter] ADD MEMBER [Stormy-PC\Administrator]
GO
ALTER ROLE [db_denydatareader] ADD MEMBER [Stormy-PC\Administrator]
GO
ALTER ROLE [db_denydatawriter] ADD MEMBER [Stormy-PC\Administrator]
GO
ALTER ROLE [db_accessadmin] ADD MEMBER [si.zhong_query##$Z]
GO
ALTER ROLE [db_owner] ADD MEMBER [NT AUTHORITY\SYSTEM]
GO
ALTER ROLE [db_accessadmin] ADD MEMBER [NT AUTHORITY\SYSTEM]
GO
ALTER ROLE [db_securityadmin] ADD MEMBER [NT AUTHORITY\SYSTEM]
GO
ALTER ROLE [db_ddladmin] ADD MEMBER [NT AUTHORITY\SYSTEM]
GO
ALTER ROLE [db_backupoperator] ADD MEMBER [NT AUTHORITY\SYSTEM]
GO
ALTER ROLE [db_datareader] ADD MEMBER [NT AUTHORITY\SYSTEM]
GO
ALTER ROLE [db_datawriter] ADD MEMBER [NT AUTHORITY\SYSTEM]
GO
ALTER ROLE [db_denydatareader] ADD MEMBER [NT AUTHORITY\SYSTEM]
GO
ALTER ROLE [db_denydatawriter] ADD MEMBER [NT AUTHORITY\SYSTEM]
GO
/****** Object:  Table [dbo].[tGameLog]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tGameLog](
	[nLogNo] [bigint] IDENTITY(1,1) NOT NULL,
	[dDate] [datetime] NOT NULL CONSTRAINT [DF__tGameLog__dDate__173876EA]  DEFAULT (getdate()),
	[nType] [int] NOT NULL,
	[nCharNo] [int] NULL,
	[sMap] [varchar](16) NULL,
	[nMapX] [int] NULL,
	[nMapY] [int] NULL,
	[nMapZ] [int] NULL,
	[nTargetCharNo] [int] NULL,
	[nTargetID] [int] NULL,
	[nItemKey] [bigint] NULL,
	[nInt1] [int] NULL,
	[nInt2] [int] NULL,
	[nInt3] [int] NULL,
	[nBigint1] [bigint] NULL,
 CONSTRAINT [PK__tGameLog__182C9B23] PRIMARY KEY CLUSTERED 
(
	[nLogNo] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[tLevelUpInfo]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tLevelUpInfo](
	[nCharNo] [int] NOT NULL,
	[nLevel] [int] NOT NULL,
	[dLastUpdated] [datetime] NOT NULL,
PRIMARY KEY NONCLUSTERED 
(
	[nCharNo] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** Object:  Index [cidx_nLevel_date]    Script Date: 12/20/2015 6:11:36 PM ******/
CREATE CLUSTERED INDEX [cidx_nLevel_date] ON [dbo].[tLevelUpInfo]
(
	[nLevel] DESC,
	[dLastUpdated] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[tQuestRank]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tQuestRank](
	[nCharNo] [int] NULL,
	[cnt] [int] NULL
) ON [PRIMARY]

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add    蝶觼董 陳瞼: 2005-05-30 螃 4:04:11 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Add]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@nCharNo int,
@sMap varchar(16),
@nMapX int,
@nMapY int,
@nMapZ int,
@nTargetCharNo int,
@nTargetID int,
@nItemKey bigint,
@nInt1 int,
@nInt2 int,
@nInt3 int,
@nBigint1 bigint
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  nCharNo,  sMap,  nMapX,  nMapY,  nMapZ,  nTargetCharNo,  nTargetID,  nItemKey,  nInt1,  nInt2,  nInt3,  nBigint1 )
VALUES          ( @nType, @nCharNo, @sMap, @nMapX, @nMapY, @nMapZ, @nTargetCharNo, @nTargetID, @nItemKey, @nInt1, @nInt2, @nInt3, @nBigint1 )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add_Type1]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_Type1    蝶觼董 陳瞼: 2005-05-30 螃 4:04:12 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_Type1    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Add_Type1]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@nCharNo int,
@sMap varchar(16),
@nMapX int,
@nMapY int,
@nMapZ int
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  nCharNo,  sMap,  nMapX,  nMapY,  nMapZ )
VALUES          ( @nType, @nCharNo, @sMap, @nMapX, @nMapY, @nMapZ )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add_Type2]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_Type2    蝶觼董 陳瞼: 2005-05-30 螃 4:04:12 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_Type2    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Add_Type2]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@nCharNo int,
@sMap varchar(16),
@nMapX int,
@nMapY int,
@nMapZ int,
@nInt1 int,
@nInt2 int
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  nCharNo,  sMap,  nMapX,  nMapY,  nMapZ,  nInt1,  nInt2 )
VALUES          ( @nType, @nCharNo, @sMap, @nMapX, @nMapY, @nMapZ, @nInt1, @nInt2 )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add_Type3]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_Type3    蝶觼董 陳瞼: 2005-05-30 螃 4:04:12 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_Type3    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Add_Type3]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@nCharNo int,
@sMap varchar(16),
@nMapX int,
@nMapY int,
@nMapZ int,
@nTargetCharNo int,
@nTargetID int,
@nInt1 int
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  nCharNo,  sMap,  nMapX,  nMapY,  nMapZ,  nTargetCharNo,  nTargetID,  nInt1 )
VALUES          ( @nType, @nCharNo, @sMap, @nMapX, @nMapY, @nMapZ, @nTargetCharNo, @nTargetID, @nInt1 )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add_Type4]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_Type4    蝶觼董 陳瞼: 2005-05-30 螃 4:04:12 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_Type4    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Add_Type4]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@nCharNo int,
@sMap varchar(16),
@nMapX int,
@nMapY int,
@nMapZ int,
@nInt1 int,
@nInt2 int,
@nInt3 int
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  nCharNo,  sMap,  nMapX,  nMapY,  nMapZ,  nInt1,  nInt2,  nInt3 )
VALUES          ( @nType, @nCharNo, @sMap, @nMapX, @nMapY, @nMapZ, @nInt1, @nInt2, @nInt3 )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add_Type5]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_Type5    蝶觼董 陳瞼: 2005-05-30 螃 4:04:12 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_Type5    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Add_Type5]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@nCharNo int,
@nInt1 int,
@nInt2 int
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  nCharNo,  nInt1,  nInt2 )
VALUES          ( @nType, @nCharNo, @nInt1, @nInt2 )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add_Type6]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_Type6    蝶觼董 陳瞼: 2005-05-30 螃 4:04:12 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_Type6    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Add_Type6]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@nCharNo int,
@sMap varchar(16),
@nMapX int,
@nMapY int,
@nMapZ int,
@nInt1 int,
@nBigint1 bigint
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  nCharNo,  sMap,  nMapX,  nMapY,  nMapZ,  nInt1,  nBigint1 )
VALUES          ( @nType, @nCharNo, @sMap, @nMapX, @nMapY, @nMapZ, @nInt1, @nBigint1 )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add_Type7]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_Type7    蝶觼董 陳瞼: 2005-05-30 螃 4:04:12 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_Type7    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Add_Type7]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@nCharNo int,
@sMap varchar(16),
@nMapX int,
@nMapY int,
@nMapZ int,
@nTargetCharNo int,
@nInt1 int,
@nInt2 int
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  nCharNo,  sMap,  nMapX,  nMapY,  nMapZ,  nTargetCharNo,  nInt1,  nInt2 )
VALUES          ( @nType, @nCharNo, @sMap, @nMapX, @nMapY, @nMapZ, @nTargetCharNo, @nInt1, @nInt2 )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add_Type8]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_Type8    蝶觼董 陳瞼: 2005-05-30 螃 4:04:12 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_Type8    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Add_Type8]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@nCharNo int,
@sMap varchar(16),
@nMapX int,
@nMapY int,
@nMapZ int,
@nInt1 int
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  nCharNo,  sMap,  nMapX,  nMapY,  nMapZ,  nInt1 )
VALUES          ( @nType, @nCharNo, @sMap, @nMapX, @nMapY, @nMapZ, @nInt1 )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add_Type9]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_Type9    蝶觼董 陳瞼: 2005-05-30 螃 4:04:12 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_Type9    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Add_Type9]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@nCharNo int,
@sMap varchar(16),
@nMapX int,
@nMapY int,
@nMapZ int,
@nItemKey bigint,
@nInt1 int,
@nInt2 int
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  nCharNo,  sMap,  nMapX,  nMapY,  nMapZ,  nItemKey,  nInt1,  nInt2 )
VALUES          ( @nType, @nCharNo, @sMap, @nMapX, @nMapY, @nMapZ, @nItemKey, @nInt1, @nInt2 )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add_TypeA]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_TypeA    蝶觼董 陳瞼: 2005-05-30 螃 4:04:12 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_TypeA    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Add_TypeA]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@nCharNo int,
@nTargetCharNo int,
@nTargetID int,
@nItemKey bigint,
@nInt1 int,
@nInt2 int,
@nInt3 int
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  nCharNo,  nTargetCharNo,  nTargetID,  nItemKey,  nInt1,  nInt2,  nInt3 )
VALUES          ( @nType, @nCharNo, @nTargetCharNo, @nTargetID, @nItemKey, @nInt1, @nInt2, @nInt3 )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add_TypeB]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_TypeB    蝶觼董 陳瞼: 2005-05-30 螃 4:04:12 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_TypeB    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Add_TypeB]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@nCharNo int,
@sMap varchar(16),
@nMapX int,
@nMapY int,
@nMapZ int,
@nTargetCharNo int,
@nTargetID int,
@nItemKey bigint,
@nInt1 int,
@nInt2 int,
@nInt3 int
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  nCharNo,  sMap,  nMapX,  nMapY,  nMapZ,  nTargetCharNo,  nTargetID,  nItemKey,  nInt1,  nInt2,  nInt3 )
VALUES          ( @nType, @nCharNo, @sMap, @nMapX, @nMapY, @nMapZ, @nTargetCharNo, @nTargetID, @nItemKey, @nInt1, @nInt2, @nInt3 )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add_TypeC]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_TypeC    蝶觼董 陳瞼: 2005-05-30 螃 4:04:12 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_TypeC    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Add_TypeC]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@nCharNo int,
@sMap varchar(16),
@nMapX int,
@nMapY int,
@nMapZ int,
@nTargetID int,
@nItemKey bigint,
@nInt1 int,
@nInt2 int,
@nInt3 int
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  nCharNo,  sMap,  nMapX,  nMapY,  nMapZ,  nTargetID,  nItemKey,  nInt1,  nInt2,  nInt3 )
VALUES          ( @nType, @nCharNo, @sMap, @nMapX, @nMapY, @nMapZ, @nTargetID, @nItemKey, @nInt1, @nInt2, @nInt3 )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add_TypeD]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_TypeD    蝶觼董 陳瞼: 2005-05-30 螃 4:04:12 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_TypeD    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Add_TypeD]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@nCharNo int,
@nItemKey bigint,
@nInt1 int,
@nInt2 int
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  nCharNo,  nItemKey,  nInt1,  nInt2 )
VALUES          ( @nType, @nCharNo, @nItemKey, @nInt1, @nInt2 )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add_TypeE]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_TypeE    蝶觼董 陳瞼: 2005-05-30 螃 4:04:12 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_TypeE    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Add_TypeE]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@sMap varchar(16),
@nMapX int,
@nMapY int,
@nMapZ int,
@nTargetID int,
@nItemKey bigint,
@nInt1 int,
@nInt2 int
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  sMap,  nMapX,  nMapY,  nMapZ,  nTargetID,  nItemKey,  nInt1,  nInt2 )
VALUES          ( @nType, @sMap, @nMapX, @nMapY, @nMapZ, @nTargetID, @nItemKey, @nInt1, @nInt2 )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add_TypeF]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_TypeF    蝶觼董 陳瞼: 2005-05-30 螃 4:04:12 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_TypeF    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Add_TypeF]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@nCharNo int,
@sMap varchar(16),
@nMapX int,
@nMapY int,
@nMapZ int,
@nTargetID int,
@nItemKey bigint,
@nInt1 int,
@nInt2 int,
@nInt3 int,
@nBigint1 bigint
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  nCharNo,  sMap,  nMapX,  nMapY,  nMapZ,  nTargetID,  nItemKey,  nInt1,  nInt2,  nInt3,  nBigint1 )
VALUES          ( @nType, @nCharNo, @sMap, @nMapX, @nMapY, @nMapZ, @nTargetID, @nItemKey, @nInt1, @nInt2, @nInt3, @nBigint1 )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add_TypeG]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_TypeG    蝶觼董 陳瞼: 2005-05-30 螃 4:04:12 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_TypeG    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Add_TypeG]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@nCharNo int,
@sMap varchar(16),
@nMapX int,
@nMapY int,
@nMapZ int,
@nTargetID int,
@nItemKey bigint,
@nInt1 int,
@nInt2 int,
@nBigint1 bigint
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  nCharNo,  sMap,  nMapX,  nMapY,  nMapZ,  nTargetID,  nItemKey,  nInt1,  nInt2,  nBigint1 )
VALUES          ( @nType, @nCharNo, @sMap, @nMapX, @nMapY, @nMapZ, @nTargetID, @nItemKey, @nInt1, @nInt2, @nBigint1 )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add_TypeH]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_TypeH    蝶觼董 陳瞼: 2005-05-30 螃 4:04:12 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_TypeH    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Add_TypeH]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@nCharNo int,
@sMap varchar(16),
@nMapX int,
@nMapY int,
@nMapZ int,
@nTargetCharNo int
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  nCharNo,  sMap,  nMapX,  nMapY,  nMapZ,  nTargetCharNo )
VALUES          ( @nType, @nCharNo, @sMap, @nMapX, @nMapY, @nMapZ, @nTargetCharNo )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add_TypeI]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_TypeI    蝶觼董 陳瞼: 2005-05-30 螃 4:04:12 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_TypeI    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Add_TypeI]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@nCharNo int,
@sMap varchar(16),
@nMapX int,
@nMapY int,
@nMapZ int,
@nTargetCharNo int,
@nTargetID int
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  nCharNo,  sMap,  nMapX,  nMapY,  nMapZ,  nTargetCharNo,  nTargetID )
VALUES          ( @nType, @nCharNo, @sMap, @nMapX, @nMapY, @nMapZ, @nTargetCharNo, @nTargetID )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add_TypeJ]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_TypeJ    蝶觼董 陳瞼: 2005-05-30 螃 4:04:12 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Add_TypeJ    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Add_TypeJ]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@nCharNo int,
@sMap varchar(16),
@nMapX int,
@nMapY int,
@nMapZ int,
@nTargetID int,
@nItemKey bigint,
@nInt1 int,
@nInt2 int
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  nCharNo,  sMap,  nMapX,  nMapY,  nMapZ,  nTargetID,  nItemKey,  nInt1,  nInt2 )
VALUES          ( @nType, @nCharNo, @sMap, @nMapX, @nMapY, @nMapZ, @nTargetID, @nItemKey, @nInt1, @nInt2 )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Add_TypeK]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[p_GameLog_Add_TypeK]
/*
 Game log add
 input:
  All Args = 煎斜縑 晦煙腆 薑爾
 output: 
  nLogNo = 蹺陛脹 煎斜曖 廓(縑楝衛 LogNo = 0 )
*/
@nLogNo bigint OUTPUT,
@nType int,
@nCharNo int,
@sMap varchar(16),
@nMapX int,
@nMapY int,
@nMapZ int,
@nInt1 int,
@nInt2 int,
@nBigint1 bigint
AS
SET NOCOUNT ON
SET @nLogNo = 0
INSERT tGameLog (  nType,  nCharNo,  sMap,  nMapX,  nMapY,  nMapZ,  nInt1,  nInt2,  nBigint1 )
VALUES          ( @nType, @nCharNo, @sMap, @nMapX, @nMapY, @nMapZ, @nInt1, @nInt2, @nBigint1 )
SET @nLogNo = @@IDENTITY
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_Get]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Get    蝶觼董 陳瞼: 2005-05-30 螃 4:04:11 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_Get    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_Get]
/*
  GameLog Get - 輿橫霞 褻勒縑 蜃朝 煎斜蒂 賅舒匐儀憮 橢朝棻.
  input:
   - 輿橫霞 褻勒瞰
  output:
   - Select脹 等檜顫
*/
@WhereExpr nvarchar(256)
AS
SET NOCOUNT ON
DECLARE @SQLCMD nvarchar(512)
SET @SQLCMD = N'SELECT nLogNo, dDate, nCharNo, nType, sMap, nMapX, nMapY, nMapZ, nTargetCharNo, nTargetID, nItemKey, nInt1, nInt2, nInt3, nBigint1 FROM tGameLog WHERE ' + @WhereExpr
EXEC sp_executesql @SQLCMD
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_GetCount]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_GetCount    蝶觼董 陳瞼: 2005-05-30 螃 4:04:11 ******/
/****** 偃羹: 盪濰 煎衛盪 dbo.p_GameLog_GetCount    蝶觼董 陳瞼: 2005-01-28 螃 7:39:26 ******/
CREATE PROCEDURE [dbo].[p_GameLog_GetCount]
/*
  GameLog Get Count - 輿橫霞 褻勒縑 蜃朝 煎斜蒂 賅舒匐儀憮 橢朝棻.
  input:
   - 輿橫霞 褻勒瞰
  output:
   - @Count = 渡 褻勒縑 虜褶朝 溯囀萄熱
*/
@WhereExpr nvarchar(256),
@Count int OUTPUT
AS
SET NOCOUNT ON
DECLARE @SQLCMD nvarchar(512)
SET @SQLCMD = N'SELECT @RowCount = COUNT(*) FROM tGameLog WHERE ' + @WhereExpr
EXEC sp_executesql @SQLCMD, N'@RowCount AS int OUTPUT', @RowCount = @Count OUTPUT
-- end

GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_GetLog]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


/*
'--------------------------------------------------------------------------------------
' 熱貲 : p_GameLog_GetLog
' 頂  辨 : OPTool 縑憮 餌辨. OPTool縑憮 殮溘 蘭葬僥縑 蜃朝 等檜攪 憮纂.
' 濛撩濠 : 檜煽晦
' 濛撩橾 : 2005喇 11錯 15橾
' 幗  蟒 : 1.0
' 檣  濠 :
'			input Parameter
'				@QueryExpr		: OPTool 縑憮 殮溘 蘭葬僥
'			Output Parameter
'				
'			RETURN_VALUE
'
'--------------------------------------------------------------------------------------
*/
CREATE PROCEDURE [dbo].[p_GameLog_GetLog]
	@QueryExpr nvarchar(256)
AS
BEGIN
	SET NOCOUNT ON
	DECLARE @SQLCMD nvarchar(512)
	SET @SQLCMD = N'SELECT a.nLogNo, a.dDate, a.nCharNo, a.nType, a.sMap, a.nMapX, a.nMapY, a.nTargetCharNo, a.nTargetID, a.nItemKey, a.nInt1, a.nInt2, a.nInt3, a.nBigint1, b.sID
			  FROM tGameLog a INNER JOIN [W00DATA].W00_Data.dbo.tCharacter b ON a.nCharNo = b.nCharNo ' + @QueryExpr
	EXEC sp_executesql @SQLCMD
	SET NOCOUNT OFF
END



GO
/****** Object:  StoredProcedure [dbo].[p_GameLog_GetLogCount]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

/*
'--------------------------------------------------------------------------------------
' 熱貲 : p_GameLog_GetLogCount
' 頂  辨 : OPTool 縑憮 餌辨. OPTool縑憮 殮溘 蘭葬僥縑 蜃朝 等檜攪 憮纂.
' 濛撩濠 : 檜煽晦
' 濛撩橾 : 2005喇 11錯 15橾
' 幗  蟒 : 1.0
' 檣  濠 :
'			input Parameter
'				@QueryExpr		: OPTool 縑憮 殮溘 蘭葬僥
'			Output Parameter
'				@Count			: 憮纂脹 等檜攪曖 偃熱
'			RETURN_VALUE
'
'--------------------------------------------------------------------------------------
*/
CREATE PROCEDURE [dbo].[p_GameLog_GetLogCount]
	@QueryExpr nvarchar(256),
	@Count int OUTPUT
	
AS
BEGIN
	SET NOCOUNT ON
	DECLARE @SQLCMD nvarchar(512)
	SET @SQLCMD = N'SELECT @RowCount = COUNT(*)
			  FROM tGameLog a INNER JOIN [W00DATA].W00_Data.dbo.tCharacter b ON a.nCharNo = b.nCharNo ' + @QueryExpr
	EXEC sp_executesql @SQLCMD, N'@RowCount AS int OUTPUT', @RowCount = @Count OUTPUT
	SET NOCOUNT OFF
END


GO
/****** Object:  StoredProcedure [dbo].[usp_Rank_setQuest]    Script Date: 12/20/2015 6:11:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[usp_Rank_setQuest]
AS
BEGIN
	IF OBJECT_ID (N'tQuestRank',N'U') IS NOT NULL
		DROP TABLE tQuestRank;

	SELECT nCharNo, count(nType)as cnt
	  INTO tQuestRank
	  FROM tGameLog
	 WHERE nType = 281 -- reward_money
	   AND nInt1 = 20016
	   AND dDate >= '2010-04-12'
	 GROUP BY nCharNo
END


GO
USE [master]
GO
ALTER DATABASE [World00_GameLog] SET  READ_WRITE 
GO
