USE [master]
GO

CREATE DATABASE box
 CONTAINMENT = NONE
 ON  PRIMARY 
( NAME = N'box_mdf', FILENAME = N'D:\SQLSERVER\inetpub\filename.mdf' , SIZE = 5120KB , MAXSIZE = UNLIMITED, FILEGROWTH = 131072KB )
 LOG ON 
( NAME = N'box_ldf', FILENAME = N'D:\SQLSERVER\inetpub\filename.ldf' , SIZE = 1024KB , MAXSIZE = 52428800KB , FILEGROWTH = 10%)
GO

USE [box]
GO

IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC box.[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [box] SET ANSI_NULL_DEFAULT OFF 
GO
ALTER DATABASE [box] SET ANSI_NULLS OFF 
GO
ALTER DATABASE [box] SET ANSI_PADDING OFF 
GO
ALTER DATABASE [box] SET ANSI_WARNINGS OFF 
GO
ALTER DATABASE [box] SET ARITHABORT OFF 
GO
ALTER DATABASE [box] SET AUTO_CLOSE OFF 
GO
ALTER DATABASE [box] SET AUTO_SHRINK OFF 
GO
ALTER DATABASE [box] SET AUTO_UPDATE_STATISTICS ON 
GO
ALTER DATABASE [box] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO
ALTER DATABASE [box] SET CURSOR_DEFAULT  GLOBAL 
GO
ALTER DATABASE [box] SET CONCAT_NULL_YIELDS_NULL OFF 
GO
ALTER DATABASE [box] SET NUMERIC_ROUNDABORT OFF 
GO
ALTER DATABASE [box] SET QUOTED_IDENTIFIER OFF 
GO
ALTER DATABASE [box] SET RECURSIVE_TRIGGERS OFF 
GO
ALTER DATABASE [box] SET  DISABLE_BROKER 
GO
ALTER DATABASE [box] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO
ALTER DATABASE [box] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO
ALTER DATABASE [box] SET TRUSTWORTHY OFF 
GO
ALTER DATABASE [box] SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO
ALTER DATABASE [box] SET PARAMETERIZATION SIMPLE 
GO
ALTER DATABASE [box] SET READ_COMMITTED_SNAPSHOT OFF 
GO
ALTER DATABASE [box] SET HONOR_BROKER_PRIORITY OFF 
GO
ALTER DATABASE [box] SET RECOVERY FULL 
GO
ALTER DATABASE [box] SET  MULTI_USER 
GO
ALTER DATABASE [box] SET PAGE_VERIFY CHECKSUM  
GO
ALTER DATABASE [box] SET DB_CHAINING OFF 
GO
ALTER DATABASE [box] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF ) 
GO
ALTER DATABASE [box] SET TARGET_RECOVERY_TIME = 0 SECONDS 
GO
ALTER DATABASE [box] SET DELAYED_DURABILITY = DISABLED 
GO
EXEC sys.sp_db_vardecimal_storage_format N'box', N'ON'
GO
USE [box]
GO
 
/****** Object:  Sequence [dbo].[SeqIden]    Script Date: 2024/7/24 14:49:54 ******/
CREATE SEQUENCE [dbo].[SeqIden] 
 AS [int]
 START WITH 1000
 INCREMENT BY 1
 MINVALUE -2147483648
 MAXVALUE 2147483647
 CYCLE 
 NO CACHE 
GO
/****** Object:  Table [dbo].[diypay]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[diypay](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[PayId] [varchar](128) NOT NULL,
	[sGameOrder] [varchar](128) NOT NULL,
	[sRoleId] [varchar](128) NOT NULL,
	[ExtData] [varchar](512) NULL,
	[Account] [varchar](128) NOT NULL,
	[SdkId] [varchar](50) NOT NULL,
	[SecSdkId] [varchar](50) NULL,
	[ServerId] [varchar](50) NOT NULL,
	[ProductId] [varchar](50) NOT NULL,
	[Gold] [money] NOT NULL,
	[DrawOut] [int] NULL,
	[DrawLevel] [int] NULL,
	[DrawTime] [datetime] NULL,
	[sChrName] [varchar](50) NULL,
	[CreateTime] [datetime] NULL,
	[nExtid] [int] NULL,
	[nExt1] [int] NULL,
 CONSTRAINT [PK__diypay__3214EC07A0A8F97B] PRIMARY KEY CLUSTERED 
(
	[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]
GO
/****** Object:  Table [dbo].[Game_Config]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Game_Config](
	[open_time] [varchar](50) NULL,
	[merge_time] [varchar](50) NULL,
	[merge_num] [int] NULL,
	[kuafu_ip] [varchar](50) NULL,
	[kuafu_port] [int] NULL,
	[kuafu_state] [int] NULL,
	[cs3v3_ip] [varchar](50) NULL,
	[cs3v3_port2] [int] NULL,
	[kuafu_date] [varchar](50) NULL,
	[cs3v3_port] [int] NULL,
	[createchr_day] [int] NULL,
	[hefu_flag] [int] NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Mir_Disble_Chat]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Mir_Disble_Chat](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[sUserId] [varchar](50) NOT NULL,
	[nTime] [int] NULL,
	[dCreateTime] [datetime] NULL,
PRIMARY KEY CLUSTERED 
(
	[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]
GO
/****** Object:  Table [dbo].[Mir_Disble_List]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Mir_Disble_List](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[sKey] [varchar](130) NULL,
	[nType] [int] NULL,
	[sMemo] [varchar](100) NULL,
	[dCreateTime] [datetime] NULL,
	[dBanTime] [bigint] NULL,
 CONSTRAINT [PK__Mir_Disb__3214EC0701CB67B1] PRIMARY KEY CLUSTERED 
(
	[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]
GO
/****** Object:  Table [dbo].[pay]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[pay](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[PayId] [varchar](128) NOT NULL,
	[sGameOrder] [varchar](128) NOT NULL,
	[sRoleId] [varchar](128) NOT NULL,
	[ExtData] [varchar](512) NULL,
	[Account] [varchar](128) NOT NULL,
	[SdkId] [varchar](50) NOT NULL,
	[SecSdkId] [varchar](50) NULL,
	[ServerId] [varchar](50) NOT NULL,
	[ProductId] [varchar](50) NOT NULL,
	[Gold] [money] NOT NULL,
	[nRealGold] [money] NULL,
	[DrawOut] [int] NULL,
	[DrawLevel] [int] NULL,
	[DrawTime] [datetime] NULL,
	[sChrName] [varchar](50) NULL,
	[CreateTime] [datetime] NULL,
	[nExtid] [int] NULL,
	[nExt1] [int] NULL,
	[OldGold] [money] NULL,
	[tOrderTime] [datetime] NULL,
	[nProductIndex] [int] NULL,
 CONSTRAINT [PK__pay__3214EC07A0A8F97B] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
 CONSTRAINT [PayGameOrder] UNIQUE NONCLUSTERED 
(
	[sGameOrder] 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:  Table [dbo].[TBL_BLACK]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_BLACK](
	[FLD_USERID] [varchar](50) NOT NULL,
	[FLD_BUSERID] [varchar](50) NOT NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_BOX_SELL]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_BOX_SELL](
	[FLD_ID] [int] IDENTITY(1,1) NOT NULL,
	[FLD_USERID] [varchar](50) NOT NULL,
	[FLD_BUYUSERID] [varchar](50) NOT NULL,
	[FLD_MONEYID] [smallint] NULL,
	[FLD_MONEY] [int] NULL,
	[FLD_ORDER] [varchar](50) NULL,
	[FLD_CREATEDATE] [datetime] NULL,
	[FLD_UPDATEEDATE] [datetime] NULL,
	[FLD_STATE] [smallint] NULL,
	[FLD_DECSTATE] [smallint] NULL,
	[FLD_GETSTATE] [smallint] NULL,
	[FLD_PAYORDER] [varchar](128) NOT NULL,
	[FLD_STATUS] [tinyint] NOT NULL,
 CONSTRAINT [PK__TBL_BOX___84774207A5B56D0B] PRIMARY KEY CLUSTERED 
(
	[FLD_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]
GO
/****** Object:  Table [dbo].[TBL_CHARACTER]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_CHARACTER](
	[FLD_ID] [int] IDENTITY(1,1) NOT NULL,
	[FLD_ACCOUNT] [varchar](128) NULL,
	[FLD_CHARACTER] [varchar](50) NULL,
	[FLD_USERID] [bigint] NULL,
	[FLD_DELETED] [tinyint] NULL,
	[FLD_UPDATEDATETIME] [datetime] NULL,
	[FLD_DBVERSION] [tinyint] NULL,
	[FLD_MAPNAME] [varchar](50) NULL,
	[FLD_CX] [float] NULL,
	[FLD_CY] [float] NULL,
	[FLD_DIR] [int] NULL,
	[FLD_HAIR] [tinyint] NULL,
	[FLD_SEX] [tinyint] NULL,
	[FLD_JOB] [tinyint] NULL,
	[FLD_LEVEL] [int] NULL,
	[FLD_HOMEMAP] [varchar](20) NULL,
	[FLD_HOMEX] [smallint] NULL,
	[FLD_HOMEY] [smallint] NULL,
	[FLD_ATTACKMODE] [bigint] NULL,
	[FLD_FIGHTZONEDIE] [tinyint] NULL,
	[FLD_INCHEALTH] [int] NULL,
	[FLD_INCSPELL] [int] NULL,
	[FLD_INCHEALING] [int] NULL,
	[FLD_BONUSPOINT] [bigint] NULL,
	[FLD_MAKEDATE] [datetime] NULL,
	[FLD_ISFIRSTCHAR] [tinyint] NULL,
	[FLD_GAMEGOLD] [bigint] NULL,
	[FLD_MASTERNAME] [varchar](50) NULL,
	[FLD_MASTER] [tinyint] NULL,
	[FLD_DEARNAME] [varchar](50) NULL,
	[FLD_GAMEPOINT] [int] NULL,
	[FLD_LOCKLOGON] [tinyint] NULL,
	[FLD_QUESTFLAG] [binary](128) NULL,
	[FLD_MARRYCOUNT] [int] NULL,
	[FLD_SELECTID] [tinyint] NULL,
	[FLD_MONEY] [binary](800) NULL,
	[FLD_BTF9] [int] NULL,
	[FLD_SYSVAR] [binary](400) NULL,
	[FLD_EE] [tinyint] NULL,
	[FLD_UVAR] [varbinary](max) NULL,
	[FLD_FEATURE] [varchar](200) NULL,
	[FLD_OFFLINE_TIME] [datetime] NULL,
	[FLD_SUCKDAMAGECOUNT] [bigint] NULL,
	[FLD_SUCKDAMAGERATE] [tinyint] NULL,
	[FLD_SUCKDAMAGEBILI] [int] NULL,
	[FLD_SNDAITEMBOXOPENED] [tinyint] NULL,
	[FLD_SDKID] [varchar](50) NULL,
	[FLD_SERVERID] [int] NULL,
	[FLD_TOTAL_RECHARGE] [int] NULL,
	[FLD_CHARACTER_OLD] [varchar](100) NULL,
	[FLD_LOCKHUM] [tinyint] NOT NULL,
	[FLD_ISBUYCHAR] [tinyint] NOT NULL,
	[FLD_JVAR] [binary](2000) NULL,
	[FLD_VARCLEARTIME] [datetime] NULL,
	[FLD_REALACCOUNT] [varchar](128) NOT NULL,
	[FLD_LOCKDATE] [datetime] NULL,
	[FLD_PAYORDER] [varchar](128) NOT NULL,
	[FLD_STATUS] [tinyint] NOT NULL,
	[FLD_HEROUSERID] [varchar](50) NOT NULL,
	[FLD_HERONAME] [varchar](50) NOT NULL,
	[FLD_SECPASSWORD] [varchar](55) NULL,
	[FLD_HumParams] [varchar](max) NULL,
	[FLD_Abil] [varbinary](max) NULL,
	[FLD_AbilMax] [varbinary](max) NULL,
	[FLD_BonusAbil] [binary](80) NULL,
	[FLD_BonusAdjust] [binary](2040) NULL,
	[FLD_NETSTATE] [bigint] NULL,
	[FLD_NETCALL] [bigint] NULL,
	[FLD_DC] [BIGINT] NULL,
 CONSTRAINT [PK__TBL_CHAR__84774207C96FBA90] PRIMARY KEY CLUSTERED 
(
	[FLD_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] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_CONFIG]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_CONFIG](
	[StartTime] [datetime] NULL,
	[recharge_config] [varchar](8000) NULL,
	[Regis] [int] NOT NULL,
	[iRegCount] [int] NULL,
	[sRegionServerName] [varchar](50) NULL,
	[HfCount] [int] NULL,
	[HfTime] [datetime] NULL,
	[kuafuip] [varchar](50) NULL,
	[kuafuport] [int] NULL,
	[kuafustate] [int] NULL,
	[kuafuinfo] [varchar](200) NULL,
	[sshowtime] [datetime] NULL,
	[FLD_JYHCannelID] [varchar](8000) NULL,
	[FLD_TTSQCannelID] [varchar](8000) NULL,
	[FLD_SERCONFIG] [varchar](max) NULL,
	[FLD_SVRSTATE] [smallint] NULL,
	[FLD_ADDRLIST] [varchar](max) NULL,
	[RegistWhiteList] [varchar](max) NULL,
	[DisableTime] [datetime] NULL,
	[DisableHFCount] [int] NULL,
	[PVPAddr] [varchar](50) NULL,
	[PVPPort] [int] NULL,
	[PVPState] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

/****** Object:  Table [dbo].[TBL_PVP_USER]    Script Date: 2025/5/21 20:24:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TBL_PVP_USER](
	[FLD_USERID] [varchar](50) NOT NULL,
	[FLD_CHARNAME] [varchar](50) NULL,
	[FLD_VALUE1] [int] NULL,
	[FLD_VALUE2] [int] NULL,
	[FLD_VALUE3] [int] NULL,
	[FLD_WIN] [int] NULL,
	[FLD_LOSE] [int] NULL,
	[FLD_JOB] [int] NULL,
	[FLD_SEX] [int] NULL,
	[FLD_LEVEL] [int] NULL,
	[FLD_DRESS] [int] NULL,
	[FLD_WEAPON] [int] NULL,
	[FLD_GAMENAME] [varchar](50) NULL,
	[FLD_GAMEID] [int] NULL,
	[FLD_SERVERID] [int] NULL,
	[FLD_TUPDATETIME] [datetime] NULL,
 CONSTRAINT [PK_TBL_PVP_USER] PRIMARY KEY CLUSTERED 
(
	[FLD_USERID] 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].[TBL_FRIEND]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_FRIEND](
	[FLD_USERID] [varchar](50) NULL,
	[FLD_FUSERID] [varchar](50) NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_GUILD_INFO]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_GUILD_INFO](
	[GuildNum] [int] NOT NULL,
	[sGuildID] [varchar](50) NOT NULL,
	[sGuildName] [varchar](128) NULL,
	[sNotice] [varchar](256) NULL,
	[Level] [smallint] NULL,
	[nGold] [int] NULL,
	[nExp] [int] NULL,
	[dCreateTime] [datetime] NULL,
	[btDeleted] [smallint] NULL,
	[btAutoJoin] [smallint] NULL,
	[nJoinLevel] [int] NULL,
	[nJoinJob] [smallint] NULL,
	[nMemberCount] [int] NULL,
	[nBuildPoint] [int] NULL,
	[nAurae] [int] NULL,
	[nStability] [int] NULL,
	[nFlourishing] [int] NULL,
	[sRank1] [varchar](50) NULL,
	[sRank2] [varchar](50) NULL,
	[sRank3] [varchar](50) NULL,
	[sRank4] [varchar](50) NULL,
	[sRank5] [varchar](50) NULL,
	[nServerID] [int] NULL,
	[AdminState] [binary](10) NULL,
 CONSTRAINT [PK_TBL_GUILD_INFO_1] PRIMARY KEY CLUSTERED 
(
	[sGuildID] 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:  Table [dbo].[TBL_GUILD_MEMBER]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_GUILD_MEMBER](
	[sGuildID] [varchar](50) NULL,
	[sGuildName] [varchar](50) NULL,
	[sUserID] [varchar](50) NULL,
	[btRank] [smallint] NULL,
	[btJob] [smallint] NULL,
	[btJoin] [smallint] NULL,
	[nLevel] [int] NULL,
	[btSex] [smallint] NULL
) ON [PRIMARY]

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_NET_INFO](
	[sNetID] [varchar](50) NOT NULL,
	[nTypeID] [int] NULL,
	[btDeleted] [smallint] NULL,
	[nServerID] [int] NULL,
 CONSTRAINT [T_TBL_NET_INFO_1] PRIMARY KEY CLUSTERED 
(
	[sNETID] 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_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_NET_MEMBER](
	[sNETID] [varchar](50) NULL,
	[sUserID] [varchar](50) NULL,
	[btRank] [smallint] NULL,
	[btJob] [smallint] NULL,
	[nLevel] [int] NULL,
	[btSex] [smallint] NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[TBL_HERO]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_HERO](
	[FLD_ID] [int] IDENTITY(1,1) NOT NULL,
	[FLD_HEROMASTERUSERID] [varchar](128) NULL,
	[FLD_MASTERNAME] [varchar](50) NULL,
	[FLD_CHARACTER] [varchar](50) NULL,
	[FLD_USERID] [varchar](50) NULL,
	[FLD_DELETED] [tinyint] NOT NULL,
	[FLD_UPDATEDATETIME] [datetime] NULL,
	[FLD_HAIR] [tinyint] NOT NULL,
	[FLD_SEX] [tinyint] NOT NULL,
	[FLD_JOB] [tinyint] NOT NULL,
	[FLD_LEVEL] [int] NOT NULL,
	[FLD_HP] [bigint] NOT NULL,
	[FLD_MP] [bigint] NOT NULL,
	[FLD_EXP] [bigint] NOT NULL,
	[FLD_PKPOINT] [int] NOT NULL,
	[FLD_BODYLUCK] [float] NOT NULL,
	[FLD_INCHEALTH] [int] NOT NULL,
	[FLD_INCSPELL] [int] NOT NULL,
	[FLD_INCHEALING] [int] NOT NULL,
	[FLD_MAKEDATE] [datetime] NULL,
	[FLD_StatusTimeArr] [binary](24) NOT NULL,
	[FLD_RELEVEL] [tinyint] NOT NULL,
	[FLD_SYSVAR] [binary](400) NOT NULL,
	[FLD_Abil] [varbinary](max) NULL,
	[FLD_AbilMax] [varbinary](max) NULL,
	[FLD_SERVERID] [int] NOT NULL,	
	[FLD_FEATURE] [varchar](200) NULL,
	[FLD_HumParams] [varchar](max) NULL,
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_HERO_BAG]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_HERO_BAG](
	[FLD_USERID] [varchar](50) NULL,
	[FLD_MAKEINDEX] [uniqueidentifier] NOT NULL,
	[FLD_INDEX] [int] NULL,
	[FLD_DURA] [int] NULL,
	[FLD_DURAMAX] [int] NULL,
	[FLD_QUALITY] [binary](300) NULL,
	[FLD_WHERE] [int] NULL,
	[FLD_OVERLAP] [int] NULL,
	[FLD_ADDVALE] [binary](240) NULL,
	[FLD_EXTEND] [binary](200) NULL,
	[FLD_ITEMADV] [binary](1500) NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_HERO_BODY]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_HERO_BODY](
	[FLD_USERID] [varchar](50) NULL,
	[FLD_MAKEINDEX] [uniqueidentifier] NOT NULL,
	[FLD_INDEX] [int] NULL,
	[FLD_DURA] [int] NULL,
	[FLD_DURAMAX] [int] NULL,
	[FLD_QUALITY] [binary](300) NULL,
	[FLD_WHERE] [int] NULL,
	[FLD_OVERLAP] [int] NULL,
	[FLD_ADDVALE] [binary](240) NULL,
	[FLD_EXTEND] [binary](200) NULL,
	[FLD_ITEMADV] [binary](1500) NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_HERO_MAGIC]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_HERO_MAGIC](
	[FLD_USERID] [varchar](50) NULL,
	[FLD_MAGICID] [int] NOT NULL,
	[FLD_LEVEL] [tinyint] NULL,
	[FLD_KEY] [tinyint] NULL,
	[FLD_CURTRAIN] [int] NULL,
	[FLD_LEVEL_UP] [int] NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_ITEM_BAG]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_ITEM_BAG](
	[FLD_USERID] [varchar](50) NULL,
	[FLD_MAKEINDEX] [uniqueidentifier] NOT NULL,
	[FLD_INDEX] [int] NULL,
	[FLD_DURA] [int] NULL,
	[FLD_DURAMAX] [int] NULL,
	[FLD_QUALITY] [binary](300) NULL,
	[FLD_WHERE] [int] NULL,
	[FLD_OVERLAP] [int] NULL,
	[FLD_ADDVALE] [binary](240) NULL,
	[FLD_EXTEND] [binary](200) NULL,
	[FLD_ITEMADV] [binary](1500) NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_ITEM_BODY]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_ITEM_BODY](
	[FLD_USERID] [varchar](50) NULL,
	[FLD_MAKEINDEX] [uniqueidentifier] NOT NULL,
	[FLD_INDEX] [int] NULL,
	[FLD_DURA] [int] NULL,
	[FLD_DURAMAX] [int] NULL,
	[FLD_QUALITY] [binary](300) NULL,
	[FLD_WHERE] [int] NULL,
	[FLD_OVERLAP] [int] NULL,
	[FLD_ADDVALE] [binary](240) NULL,
	[FLD_EXTEND] [binary](200) NULL,
	[FLD_ITEMADV] [binary](1500) NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_ITEM_PAIMAI]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_ITEM_PAIMAI](
	[FLD_MAKEINDEX] [uniqueidentifier] NOT NULL,
	[FLD_INDEX] [int] NOT NULL,
	[FLD_DURA] [int] NOT NULL,
	[FLD_DURAMAX] [int] NOT NULL,
	[FLD_QUALITY] [binary](300) NULL,
	[FLD_ADDVALUE] [binary](240) NOT NULL,
	[FLD_WHERE] [int] NOT NULL,
	[FLD_OVERLAP] [int] NOT NULL,
	[FLD_USERID] [varchar](50) NOT NULL,
	[FLD_TYPE] [int] NOT NULL,
	[FLD_PRICE] [int] NOT NULL,
	[FLD_ADDTIME] [int] NOT NULL,
	[FLD_USERLIST] [varchar](3000) NOT NULL,
	[FLD_JOINUSERLIST] [varchar](1500) NOT NULL,
	[FLD_LASTPRICE] [int] NOT NULL,
	[FLD_CURRUSERID] [varchar](50) NOT NULL,
	[FLD_PAGE] [smallint] NOT NULL,
	[FLD_LASTTIME] [int] NOT NULL,
	[FLD_FLAG] [smallint] NOT NULL,
	[FLD_ID] [int] NOT NULL,
	[FLD_GUILDID] [varchar](50) NOT NULL,
	[FLD_MEGUILDRATE] [int] NOT NULL,
	[FLD_STDMODE] [int] NOT NULL,
	[FLD_NEWTYPE] [int] NOT NULL,
	[FLD_JOB] [smallint] NOT NULL,
	[FLD_LEVEL] [int] NOT NULL,
	[FLD_EXTENDINFO] [binary](200) NULL,
	[FLD_ITEMADV] [binary](1500) NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_ITEM_QIUGOU]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_ITEM_QIUGOU](
	[sGuid] [varchar](40) NOT NULL,
	[sUserId] [varchar](50) NOT NULL,
	[nItemId] [int] NOT NULL,
	[nStdMode] [int] NOT NULL,
	[nCurrency] [int] NOT NULL,
	[nTotalQty] [int] NOT NULL,
	[nMinQty] [int] NOT NULL,
	[nRemainQty] [int] NOT NULL,
	[nWaitRecQty] [int] NOT NULL,
	[nRecedQty] [int] NOT NULL,
	[nPrice] [int] NOT NULL,
	[nAmount] [bigint] NOT NULL,
	[nStartTime] [int] NOT NULL,
	[nEndTime] [int] NOT NULL,
	[bDelete] [bit] NOT NULL,
	[nServerId] [int] NOT NULL,
 CONSTRAINT [PK_TBL_ITEM_QIUGOU_sGuid] PRIMARY KEY CLUSTERED 
(
	[sGuid] 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:  Table [dbo].[TBL_ITEM_STORAGE]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_ITEM_STORAGE](
	[FLD_USERID] [varchar](50) NULL,
	[FLD_MAKEINDEX] [uniqueidentifier] NOT NULL,
	[FLD_INDEX] [int] NULL,
	[FLD_DURA] [int] NULL,
	[FLD_DURAMAX] [int] NULL,
	[FLD_QUALITY] [binary](300) NULL,
	[FLD_WHERE] [int] NULL,
	[FLD_OVERLAP] [int] NULL,
	[FLD_ADDVALE] [binary](240) NULL,
	[FLD_EXTEND] [binary](200) NULL,
	[FLD_ITEMADV] [binary](1500) NULL
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[TBL_LINE]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_LINE](
	[nId] [int] IDENTITY(1,1) NOT NULL,
	[Time] [int] NULL,
	[Num] [int] NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_MAGIC]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_MAGIC](
	[FLD_USERID] [varchar](50) NULL,
	[FLD_MAGICID] [int] NOT NULL,
	[FLD_LEVEL] [tinyint] NULL,
	[FLD_KEY] [tinyint] NULL,
	[FLD_CURTRAIN] [int] NULL,
	[FLD_LEVEL_UP] [int] NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TBL_MAIL]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_MAIL] (
  [ID] int IDENTITY(1,1) NOT NULL,
  [UserID] varchar(50)  NOT NULL,
  [SendName] varchar(128)  NULL,
  [Type] int NULL,
  [Lable] varchar(50)  NULL,
  [Memo] varchar(2048)  NULL,
  [Item] varchar(max)  NULL,
  [dCreateTime] datetime NULL,
  [dRecvTime] datetime NULL,
  [ReadFlag] smallint NULL,
  [RecvFlag] smallint NULL,
  [Deleted] smallint NULL,
  [dDeleteTime] datetime NULL,
PRIMARY KEY CLUSTERED 
(
	[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]
GO
/****** Object:  Table [dbo].[TBL_NATION_INFO]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_NATION_INFO](
	[nIdx] [int] NOT NULL,
	[sNationUID] [varchar](50) NOT NULL,
	[sNationName] [varchar](128) NULL,
	[nLevel] [smallint] NULL,
	[nGold] [int] NULL,
	[nExp] [int] NULL,
	[dCreateTime] [datetime] NULL,
	[btDeleted] [smallint] NULL,
	[nMemberCount] [int] NULL,
	[nAdvValue] [int] NULL,
	[sRanks] [varchar](500) NULL,
	[nServerID] [int] NULL,
 CONSTRAINT [PK__TBL_NATI__2AD156350D5A9384] PRIMARY KEY CLUSTERED 
(
	[sNationUID] 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:  Table [dbo].[TBL_NATION_MEMBER]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_NATION_MEMBER](
	[nIdx] [varchar](50) NULL,
	[sUserID] [varchar](50) NULL,
	[btRank] [smallint] NULL,
	[btJob] [smallint] NULL,
	[btJoin] [smallint] NULL,
	[nLevel] [int] NULL,
	[nAdvValue] [int] NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[TBL_NATION_MEMBER] SET (LOCK_ESCALATION = TABLE)
GO

-- -----------------国家系统-----------------

-- -----------------交易行后台查询表-----------------
CREATE TABLE [dbo].[TBL_QUESTINFO] (
  [FLD_ID] int IDENTITY(1,1) NOT NULL,
  [questid] varchar(30)  DEFAULT ((0)) NULL,
  [questStatus] smallint DEFAULT ((0)) NULL,
  [questMsg] varchar(30) DEFAULT ('') NULL,
  [questdate] [datetime] NULL
)
GO

ALTER TABLE [dbo].[TBL_QUESTINFO] SET (LOCK_ESCALATION = TABLE)
GO

/****** Object:  Table [dbo].[TBL_PET]    Script Date: 2024/7/24 14:49:54 ******/
CREATE TABLE [dbo].[TBL_PET] (
[FLD_ID] int IDENTITY(1,1) NOT NULL,
[FLD_MASTERUSERID] bigint NOT NULL,
[FLD_USERID] bigint NOT NULL,
[FLD_MASTERNAME] varchar(50) NULL,
[FLD_PETIDX] int DEFAULT ((0)) NOT NULL,
[FLD_PETNAME] varchar(50) NULL,
[FLD_Abil] varbinary(max) NULL,
[FLD_BODYITEM] varchar(200) DEFAULT  ('') NULL,
[FLD_StatusTimeArr] binary(30) DEFAULT ((0)) NULL,
[FLD_STATE] tinyint DEFAULT ((1)) NULL,
[FLD_MAKEDATE] datetime NULL,
[FLD_UPDATEDATETIME] datetime NULL,
[FLD_DELETED] tinyint DEFAULT ((0)) NOT NULL,
)
GO

CREATE NONCLUSTERED INDEX [II_PET_MASTERID]
ON [dbo].[TBL_PET] (
  [FLD_MASTERUSERID] ASC
)
GO

CREATE NONCLUSTERED INDEX [II_PET_USERID]
ON [dbo].[TBL_PET] (
  [FLD_USERID] ASC
)
GO

/****** Object:  Table [dbo].[TBL_SORT]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TBL_SORT](
	[FLD_USERID] [varchar](50) NOT NULL,
	[FLD_SORTDATA0] [bigint] NULL,
	[FLD_SORTDATA1] [bigint] NULL,
	[FLD_SORTDATA2] [bigint] NULL,
	[FLD_SORTDATA3] [bigint] NULL,
	[FLD_SORTDATA4] [bigint] NULL,
	[FLD_SORTDATA5] [bigint] NULL,
	[FLD_SORTDATA6] [bigint] NULL,
	[FLD_SORTDATA7] [bigint] NULL,
	[FLD_SORTDATA8] [bigint] NULL,
	[FLD_SORTDATA9] [bigint] NULL,
	[FLD_SORTDATA10] [bigint] NULL,
	[FLD_SORTDATA11] [bigint] NULL,
	[FLD_SORTDATA12] [bigint] NULL,
	[FLD_SORTDATA13] [bigint] NULL,
	[FLD_SORTDATA14] [bigint] NULL,
	[FLD_SORTDATA15] [bigint] NULL,
	[FLD_SORTDATA16] [bigint] NULL,
	[FLD_SORTDATA17] [bigint] NULL,
	[FLD_SORTDATA18] [bigint] NULL,
	[FLD_SORTDATA19] [bigint] NULL,
	[FLD_SORTDATA20] [bigint] NULL,
	[FLD_SORTDATA21] [bigint] NULL,
	[FLD_SORTDATA22] [bigint] NULL,
	[FLD_SORTDATA23] [bigint] NULL,
	[FLD_SORTDATA24] [bigint] NULL,
	[FLD_SORTDATA25] [bigint] NULL,
	[FLD_SORTDATA26] [bigint] NULL,
	[FLD_SORTDATA27] [bigint] NULL,
	[FLD_SORTDATA28] [bigint] NULL,
	[FLD_SORTDATA29] [bigint] NULL,
	[FLD_SORTTIME0] [datetime] NULL,
	[FLD_SORTTIME1] [datetime] NULL,
	[FLD_SORTTIME2] [datetime] NULL,
	[FLD_SORTTIME3] [datetime] NULL,
	[FLD_SORTTIME4] [datetime] NULL,
	[FLD_SORTTIME5] [datetime] NULL,
	[FLD_SORTTIME6] [datetime] NULL,
	[FLD_SORTTIME7] [datetime] NULL,
	[FLD_SORTTIME8] [datetime] NULL,
	[FLD_SORTTIME9] [datetime] NULL,
	[FLD_SORTTIME10] [datetime] NULL,
	[FLD_SORTTIME11] [datetime] NULL,
	[FLD_SORTTIME12] [datetime] NULL,
	[FLD_SORTTIME13] [datetime] NULL,
	[FLD_SORTTIME14] [datetime] NULL,
	[FLD_SORTTIME15] [datetime] NULL,
	[FLD_SORTTIME16] [datetime] NULL,
	[FLD_SORTTIME17] [datetime] NULL,
	[FLD_SORTTIME18] [datetime] NULL,
	[FLD_SORTTIME19] [datetime] NULL,
	[FLD_SORTTIME20] [datetime] NULL,
	[FLD_SORTTIME21] [datetime] NULL,
	[FLD_SORTTIME22] [datetime] NULL,
	[FLD_SORTTIME23] [datetime] NULL,
	[FLD_SORTTIME24] [datetime] NULL,
	[FLD_SORTTIME25] [datetime] NULL,
	[FLD_SORTTIME26] [datetime] NULL,
	[FLD_SORTTIME27] [datetime] NULL,
	[FLD_SORTTIME28] [datetime] NULL,
	[FLD_SORTTIME29] [datetime] NULL,
 CONSTRAINT [PK_TBL_SORT] PRIMARY KEY CLUSTERED 
(
	[FLD_USERID] 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

-- ----------------------------
-- Table structure for TBL_VAR_ITEM
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[TBL_VAR_ITEM]') AND type IN ('U'))
	DROP TABLE [dbo].[TBL_VAR_ITEM]
GO

CREATE TABLE [dbo].[TBL_VAR_ITEM] (
  [uGuid] uniqueidentifier DEFAULT (newid()) NOT NULL,
  [FLD_MakeIndex] uniqueidentifier DEFAULT (newid()) NOT NULL,
  [FLD_VAR_NAME] varchar(50) NOT NULL,
  [FLD_INTVALUE] bigint DEFAULT ((0)) NULL,
  [FLD_STRVALUE] varchar(max)  NULL,
  [FLD_TYPE] smallint DEFAULT ((0)) NOT NULL,
  [FLD_TIMESTAMP] timestamp NOT NULL,
  [tUpdateTime] datetime DEFAULT (getdate()) NULL,
  [tClear] datetime DEFAULT ((0)) NULL
)
GO

ALTER TABLE [dbo].[TBL_VAR_ITEM] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Table structure for TBL_VAR_OTHER
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[TBL_VAR_OTHER]') AND type IN ('U'))
	DROP TABLE [dbo].[TBL_VAR_OTHER]
GO

CREATE TABLE [dbo].[TBL_VAR_OTHER] (
  [uGuid] uniqueidentifier DEFAULT (newid()) NOT NULL,
  [FLD_USERID] varchar(50)  NOT NULL,
  [FLD_VAR_NAME] varchar(50) NOT NULL,
  [FLD_INTVALUE] bigint DEFAULT ((0)) NULL,
  [FLD_STRVALUE] varchar(max)  NULL,
  [FLD_TYPE] smallint DEFAULT ((0)) NOT NULL,
  [FLD_TIMESTAMP] timestamp NOT NULL,
  [tUpdateTime] datetime DEFAULT (getdate()) NULL,
  [tClear] datetime DEFAULT ((0)) NULL
)
GO

ALTER TABLE [dbo].[TBL_VAR_OTHER] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Table structure for TBL_VAR_ROLE
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[TBL_VAR_ROLE]') AND type IN ('U'))
	DROP TABLE [dbo].[TBL_VAR_ROLE]
GO

CREATE TABLE [dbo].[TBL_VAR_ROLE] (
  [uGuid] uniqueidentifier DEFAULT (newid()) NOT NULL,
  [FLD_USERID] bigint NOT NULL,
  [FLD_VAR_NAME] varchar(50) NOT NULL,
  [FLD_INTVALUE] bigint DEFAULT ((0)) NULL,
  [FLD_STRVALUE] varchar(max)  NULL,
  [FLD_TYPE] smallint DEFAULT ((0)) NOT NULL,
  [FLD_TIMESTAMP] timestamp NOT NULL,
  [tUpdateTime] datetime DEFAULT (getdate()) NULL,
  [tClear] datetime DEFAULT ((0)) NULL
)
GO

ALTER TABLE [dbo].[TBL_VAR_ROLE] SET (LOCK_ESCALATION = TABLE)
GO


-- ----------------------------
-- Table structure for TBL_VAR_SYS
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[TBL_VAR_SYS]') AND type IN ('U'))
	DROP TABLE [dbo].[TBL_VAR_SYS]
GO

CREATE TABLE [dbo].[TBL_VAR_SYS] (
  [uGuid] uniqueidentifier DEFAULT (newid()) NOT NULL,
  [FLD_VAR_NAME] varchar(50)  NOT NULL,
  [FLD_INTVALUE] bigint DEFAULT ((0)) NULL,
  [FLD_STRVALUE] varchar(max)  NULL,
  [FLD_TYPE] smallint DEFAULT ((0)) NOT NULL,
  [FLD_TIMESTAMP] timestamp NOT NULL,
  [tUpdateTime] datetime DEFAULT (getdate()) NULL,
  [FLD_JOIN] tinyint DEFAULT ((0)) NULL,
  [tClear] datetime DEFAULT ((0)) NULL
)
GO

ALTER TABLE [dbo].[TBL_VAR_SYS] SET (LOCK_ESCALATION = TABLE)
GO


IF NOT EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[TBL_MERGECLEARDATA]') AND type IN ('U'))
BEGIN
	CREATE TABLE [dbo].[TBL_MERGECLEARDATA](
		[nId] [int] IDENTITY(1,1) NOT NULL,
		[nServerId] [int] NULL,
		[tTime] [datetime] NULL,
		[sType] [varchar](100) NULL,
		[sReason] [varchar](100) NULL,
		[sDBName] [varchar](100) NULL,
		[sAccount] [varchar](100) NULL,
		[sUserId] [varchar](100) NULL,
		[sUserName] [varchar](100) NULL,
		[sMemo] [varchar](max) NULL,
		[nJob] [int] NULL,
		[nLevel] [int] NULL,
	PRIMARY KEY CLUSTERED 
	(
		[nId] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
	) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
END
GO
IF NOT EXISTS(SELECT TOP 1 1 FROM SYSINDEXES WHERE id=OBJECT_ID('TBL_MERGECLEARDATA') and name='IX_TBL_MERGECLEARDATA_tTime')
	CREATE NONCLUSTERED INDEX [IX_TBL_MERGECLEARDATA_tTime] ON [dbo].[TBL_MERGECLEARDATA]([tTime])
IF NOT EXISTS(SELECT TOP 1 1 FROM SYSINDEXES WHERE id=OBJECT_ID('TBL_MERGECLEARDATA') and name='IX_TBL_MERGECLEARDATA_sAccount')
	CREATE NONCLUSTERED INDEX [IX_TBL_MERGECLEARDATA_sAccount] ON [dbo].[TBL_MERGECLEARDATA]([sAccount])
IF NOT EXISTS(SELECT TOP 1 1 FROM SYSINDEXES WHERE id=OBJECT_ID('TBL_MERGECLEARDATA') and name='IX_TBL_MERGECLEARDATA_sUserId')
	CREATE NONCLUSTERED INDEX [IX_TBL_MERGECLEARDATA_sUserId] ON [dbo].[TBL_MERGECLEARDATA]([sUserId])
IF NOT EXISTS(SELECT TOP 1 1 FROM SYSINDEXES WHERE id=OBJECT_ID('TBL_MERGECLEARDATA') and name='IX_TBL_MERGECLEARDATA_sUserName')
	CREATE NONCLUSTERED INDEX [IX_TBL_MERGECLEARDATA_sUserName] ON [dbo].[TBL_MERGECLEARDATA]([sUserName])
GO


-- ----------------------------
-- Indexes structure for table TBL_VAR_ITEM
-- ----------------------------
CREATE NONCLUSTERED INDEX [IDX_ITEMVAR_MAKEINDEX]
ON [dbo].[TBL_VAR_ITEM] (
  [FLD_MakeIndex] ASC
)
GO

CREATE NONCLUSTERED INDEX [IDX_ITEMVAR_MAKEINDEX_NAME]
ON [dbo].[TBL_VAR_ITEM] (
  [FLD_MakeIndex] ASC,
  [FLD_VAR_NAME] ASC
)
GO


-- ----------------------------
-- Primary Key structure for table TBL_VAR_ITEM
-- ----------------------------
ALTER TABLE [dbo].[TBL_VAR_ITEM] ADD CONSTRAINT [PK__TBL_ITEM__7182A455AB4EF6B2] PRIMARY KEY CLUSTERED ([uGuid])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = OFF, ALLOW_PAGE_LOCKS = OFF)  
ON [PRIMARY]
GO


-- ----------------------------
-- Indexes structure for table TBL_VAR_OTHER
-- ----------------------------
CREATE NONCLUSTERED INDEX [IDX_OTHERVAR_USERID]
ON [dbo].[TBL_VAR_OTHER] (
  [FLD_USERID] ASC
)
GO

CREATE NONCLUSTERED INDEX [IDX_OTHERVAR_USERID_NAME]
ON [dbo].[TBL_VAR_OTHER] (
  [FLD_USERID] ASC,
  [FLD_VAR_NAME] ASC
)
GO


-- ----------------------------
-- Primary Key structure for table TBL_VAR_OTHER
-- ----------------------------
ALTER TABLE [dbo].[TBL_VAR_OTHER] ADD CONSTRAINT [PK__TBL_VAR___7182A45503D28189] PRIMARY KEY CLUSTERED ([uGuid])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = OFF, ALLOW_PAGE_LOCKS = OFF)  
ON [PRIMARY]
GO


-- ----------------------------
-- Indexes structure for table TBL_VAR_ROLE
-- ----------------------------
CREATE NONCLUSTERED INDEX [IDX_ROLEVAR_USERID]
ON [dbo].[TBL_VAR_ROLE] (
  [FLD_USERID] ASC
)
GO

CREATE NONCLUSTERED INDEX [IDX_ROLEVAR_USERID_NAME]
ON [dbo].[TBL_VAR_ROLE] (
  [FLD_USERID] ASC,
  [FLD_VAR_NAME] ASC
)
GO


-- ----------------------------
-- Primary Key structure for table TBL_VAR_ROLE
-- ----------------------------
ALTER TABLE [dbo].[TBL_VAR_ROLE] ADD CONSTRAINT [PK__TBL_ITEM__7182A455AB4EF6B2_copy2] PRIMARY KEY CLUSTERED ([uGuid])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = OFF, ALLOW_PAGE_LOCKS = OFF)  
ON [PRIMARY]
GO


-- ----------------------------
-- Indexes structure for table TBL_VAR_SYS
-- ----------------------------
CREATE NONCLUSTERED INDEX [IDX_SYSVAR_NAME]
ON [dbo].[TBL_VAR_SYS] (
  [FLD_VAR_NAME] ASC
)
GO


-- ----------------------------
-- Primary Key structure for table TBL_VAR_SYS
-- ----------------------------
ALTER TABLE [dbo].[TBL_VAR_SYS] ADD CONSTRAINT [PK__TBL_ITEM__7182A455AB4EF6B2_copy1] PRIMARY KEY CLUSTERED ([uGuid])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = OFF, ALLOW_PAGE_LOCKS = OFF)  
ON [PRIMARY]
GO

/****** Object:  Table [dbo].[TLOG_BOX_SELL]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TLOG_BOX_SELL](
	[FLD_ID] [int] IDENTITY(1,1) NOT NULL,
	[FLD_USERID] [varchar](50) NOT NULL,
	[FLD_BUYUSERID] [varchar](50) NOT NULL,
	[FLD_MONEYID] [smallint] NULL,
	[FLD_MONEY] [int] NULL,
	[FLD_ORDER] [varchar](50) NULL,
	[FLD_CREATEDATE] [datetime] NULL,
	[FLD_UPDATEEDATE] [datetime] NULL,
	[FLD_STATE] [smallint] NULL,
	[FLD_DECSTATE] [smallint] NULL,
	[FLD_GETSTATE] [smallint] NULL,
	[FLD_PAYORDER] [varchar](128) NOT NULL,
	[FLD_STATUS] [tinyint] NOT NULL,
 CONSTRAINT [PK__TLOG_BOX_SELL] PRIMARY KEY CLUSTERED 
(
	[FLD_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]
GO
/****** Object:  Index [FLD_ID_IDX]    Script Date: 2024/7/24 14:49:54 ******/
CREATE UNIQUE NONCLUSTERED INDEX [FLD_ID_IDX] ON [dbo].[TBL_BOX_SELL]
(
	[FLD_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON
GO


/****** Object:  Table [dbo].[TBL_BOX_SELLITEM]    Script Date: 08/25/2023 18:12:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo].[TBL_BOX_SELLITEM](
	[FLD_ID] [int] IDENTITY(1,1) NOT NULL,
	[FLD_USERID] [varchar](50) NOT NULL,
	[FLD_BUYUSERID] [varchar](50) NOT NULL,
	[FLD_ORDER] [varchar](50) NULL,
	[FLD_CREATEDATE] [datetime] NULL,
	[FLD_UPDATEEDATE] [datetime] NULL,
	[FLD_STATE] [smallint] NULL,
	[FLD_ITEMINFO] [varchar](4096) NOT NULL,
 CONSTRAINT [PK__TBL_BOX_SELLITEM] PRIMARY KEY CLUSTERED 
(
	[FLD_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]
GO
CREATE UNIQUE NONCLUSTERED INDEX [TBL_BOX_SELLITEM_FLD_ID] ON [dbo].[TBL_BOX_SELLITEM] 
(
	[FLD_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO





/****** Object:  Index [IX_TBL_BOX_SELL_FLD_ORDER]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_BOX_SELL_FLD_ORDER] ON [dbo].[TBL_BOX_SELL]
(
	[FLD_ORDER] 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:  Index [IX_TBL_BOX_SELL_FLD_STATE]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_BOX_SELL_FLD_STATE] ON [dbo].[TBL_BOX_SELL]
(
	[FLD_STATE] 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
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_TBL_BOX_SELL_FLD_USERID]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_BOX_SELL_FLD_USERID] ON [dbo].[TBL_BOX_SELL]
(
	[FLD_USERID] 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
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_TBL_CHARACTER_FLD_ACCOUNT]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_CHARACTER_FLD_ACCOUNT] ON [dbo].[TBL_CHARACTER]
(
	[FLD_ACCOUNT] 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
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_TBL_CHARACTER_FLD_CHARACTER]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_CHARACTER_FLD_CHARACTER] ON [dbo].[TBL_CHARACTER]
(
	[FLD_CHARACTER] 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
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_TBL_CHARACTER_FLD_REALACCOUNT]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_CHARACTER_FLD_REALACCOUNT] ON [dbo].[TBL_CHARACTER]
(
	[FLD_REALACCOUNT] 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:  Index [IX_TBL_CHARACTER_FLD_UPDATEDATETIME]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_CHARACTER_FLD_UPDATEDATETIME] ON [dbo].[TBL_CHARACTER]
(
	[FLD_UPDATEDATETIME] 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:  Index [IX_TBL_CHARACTER_FLD_USERID]    Script Date: 2024/7/24 14:49:54 ******/
CREATE UNIQUE NONCLUSTERED INDEX [IX_TBL_CHARACTER_FLD_USERID] ON [dbo].[TBL_CHARACTER]
(
	[FLD_USERID] 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:  Index [IX_TBL_HERO_BAG_FLD_MAKEINDEX]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_HERO_BAG_FLD_MAKEINDEX] ON [dbo].[TBL_HERO_BAG]
(
	[FLD_MAKEINDEX] 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
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_TBL_HERO_BAG_FLD_USERID]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_HERO_BAG_FLD_USERID] ON [dbo].[TBL_HERO_BAG]
(
	[FLD_USERID] 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:  Index [IX_TBL_HERO_BODY_FLD_MAKEINDEX]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_HERO_BODY_FLD_MAKEINDEX] ON [dbo].[TBL_HERO_BODY]
(
	[FLD_MAKEINDEX] 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
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_TBL_HERO_BODY_FLD_USERID]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_HERO_BODY_FLD_USERID] ON [dbo].[TBL_HERO_BODY]
(
	[FLD_USERID] 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
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_TBL_HERO_MAGIC_FLD_USERID]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_HERO_MAGIC_FLD_USERID] ON [dbo].[TBL_HERO_MAGIC]
(
	[FLD_USERID] 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:  Index [IX_TBL_ITEM_BAG_FLD_MAKEINDEX]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_ITEM_BAG_FLD_MAKEINDEX] ON [dbo].[TBL_ITEM_BAG]
(
	[FLD_MAKEINDEX] 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
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_TBL_ITEM_BAG_FLD_USERID]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_ITEM_BAG_FLD_USERID] ON [dbo].[TBL_ITEM_BAG]
(
	[FLD_USERID] 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:  Index [IX_TBL_ITEM_BODY_FLD_MAKEINDEX]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_ITEM_BODY_FLD_MAKEINDEX] ON [dbo].[TBL_ITEM_BODY]
(
	[FLD_MAKEINDEX] 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
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_TBL_ITEM_BODY_FLD_USERID]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_ITEM_BODY_FLD_USERID] ON [dbo].[TBL_ITEM_BODY]
(
	[FLD_USERID] 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:  Index [IX_TBL_ITEM_PAIMAI_MAKEINDEX]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_ITEM_PAIMAI_MAKEINDEX] ON [dbo].[TBL_ITEM_PAIMAI]
(
	[FLD_MAKEINDEX] 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:  Index [IX_TBL_ITEM_STORAGE_FLD_MAKEINDEX]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_ITEM_STORAGE_FLD_MAKEINDEX] ON [dbo].[TBL_ITEM_STORAGE]
(
	[FLD_MAKEINDEX] 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
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_TBL_ITEM_STORAGE_FLD_USERID]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_ITEM_STORAGE_FLD_USERID] ON [dbo].[TBL_ITEM_STORAGE]
(
	[FLD_USERID] 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
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_TBL_MAGIC_FLD_USERID]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_MAGIC_FLD_USERID] ON [dbo].[TBL_MAGIC]
(
	[FLD_USERID] 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:  Index [IX_TBL_MAIL_dCreateTime]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_MAIL_dCreateTime] ON [dbo].[TBL_MAIL]
(
	[dCreateTime] 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
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_TBL_MAIL_UserID]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_MAIL_UserID] ON [dbo].[TBL_MAIL]
(
	[UserID] 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
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_TBL_PET_FLD_USERID]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TBL_PET_FLD_USERID] ON [dbo].[TBL_PET]
(
	[FLD_USERID] 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
SET ANSI_PADDING ON
GO
/****** Object:  Index [FLD_ID_IDX]    Script Date: 2024/7/24 14:49:54 ******/
CREATE UNIQUE NONCLUSTERED INDEX [FLD_ID_IDX] ON [dbo].[TLOG_BOX_SELL]
(
	[FLD_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_TLOG_BOX_SELL_FLD_ORDER]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TLOG_BOX_SELL_FLD_ORDER] ON [dbo].[TLOG_BOX_SELL]
(
	[FLD_ORDER] 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:  Index [IX_TLOG_BOX_SELL_FLD_STATE]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TLOG_BOX_SELL_FLD_STATE] ON [dbo].[TLOG_BOX_SELL]
(
	[FLD_STATE] 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
SET ANSI_PADDING ON
GO
/****** Object:  Index [IX_TLOG_BOX_SELL_FLD_USERID]    Script Date: 2024/7/24 14:49:54 ******/
CREATE NONCLUSTERED INDEX [IX_TLOG_BOX_SELL_FLD_USERID] ON [dbo].[TLOG_BOX_SELL]
(
	[FLD_USERID] 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
ALTER TABLE [dbo].[Mir_Disble_Chat] ADD  DEFAULT (getdate()) FOR [dCreateTime]
GO
ALTER TABLE [dbo].[Mir_Disble_List] ADD  DEFAULT (getdate()) FOR [dCreateTime]
GO
ALTER TABLE [dbo].[TBL_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_MONEYID]
GO
ALTER TABLE [dbo].[TBL_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_MONEY]
GO
ALTER TABLE [dbo].[TBL_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_STATE]
GO
ALTER TABLE [dbo].[TBL_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_DECSTATE]
GO
ALTER TABLE [dbo].[TBL_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_GETSTATE]
GO
ALTER TABLE [dbo].[TBL_BOX_SELL] ADD  DEFAULT ('') FOR [FLD_PAYORDER]
GO
ALTER TABLE [dbo].[TBL_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_STATUS]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_U__01D345B0]  DEFAULT ('') FOR [FLD_USERID]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_D__02C769E9]  DEFAULT ((0)) FOR [FLD_DELETED]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_D__03BB8E22]  DEFAULT ((0)) FOR [FLD_DBVERSION]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_M__04AFB25B]  DEFAULT ('') FOR [FLD_MAPNAME]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_C__05A3D694]  DEFAULT ((0)) FOR [FLD_CX]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_C__0697FACD]  DEFAULT ((0)) FOR [FLD_CY]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_D__078C1F06]  DEFAULT ((0)) FOR [FLD_DIR]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_H__123EB7A3]  DEFAULT ((1)) FOR [FLD_HAIR]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_H__NETSTATE]  DEFAULT ((9223372036854775807)) FOR [FLD_NETSTATE]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_H__DC]  DEFAULT ((0)) FOR [FLD_DC]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_H__NETCALL6]  DEFAULT ((0)) FOR [FLD_NETCALL]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_L__09746778]  DEFAULT ((0)) FOR [FLD_LEVEL]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_H__0E391C95]  DEFAULT ('') FOR [FLD_HOMEMAP]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_H__0F2D40CE]  DEFAULT ((0)) FOR [FLD_HOMEX]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_H__10216507]  DEFAULT ((0)) FOR [FLD_HOMEY]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_A__12FDD1B2]  DEFAULT ((0)) FOR [FLD_ATTACKMODE]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_F__13F1F5EB]  DEFAULT ((0)) FOR [FLD_FIGHTZONEDIE]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_I__15DA3E5D]  DEFAULT ((0)) FOR [FLD_INCHEALTH]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_I__16CE6296]  DEFAULT ((0)) FOR [FLD_INCSPELL]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_I__17C286CF]  DEFAULT ((0)) FOR [FLD_INCHEALING]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_I__1A9EF37A]  DEFAULT ((0)) FOR [FLD_ISFIRSTCHAR]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_G__1D7B6025]  DEFAULT ((0)) FOR [FLD_GAMEGOLD]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_M__1F63A897]  DEFAULT ('') FOR [FLD_MASTERNAME]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_M__2057CCD0]  DEFAULT ((0)) FOR [FLD_MASTER]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_D__214BF109]  DEFAULT ('') FOR [FLD_DEARNAME]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_G__2334397B]  DEFAULT ((0)) FOR [FLD_GAMEPOINT]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_L__251C81ED]  DEFAULT ((0)) FOR [FLD_LOCKLOGON]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_Q__2BC97F7C]  DEFAULT ((0)) FOR [FLD_QUESTFLAG]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_M__2CBDA3B5]  DEFAULT ((0)) FOR [FLD_MARRYCOUNT]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_S__373B3228]  DEFAULT ((0)) FOR [FLD_SELECTID]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_M__382F5661]  DEFAULT ((0)) FOR [FLD_MONEY]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_B__39237A9A]  DEFAULT ((0)) FOR [FLD_BTF9]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_S__3A179ED3]  DEFAULT ((0)) FOR [FLD_SYSVAR]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_E__3B0BC30C]  DEFAULT ((0)) FOR [FLD_EE]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_U__3BFFE745]  DEFAULT ((0)) FOR [FLD_UVAR]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_O__3CF40B7E]  DEFAULT (NULL) FOR [FLD_OFFLINE_TIME]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_T__3DE82FB7]  DEFAULT ((0)) FOR [FLD_TOTAL_RECHARGE]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_C__3EDC53F0]  DEFAULT ('') FOR [FLD_CHARACTER_OLD]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_L__3FD07829]  DEFAULT ((0)) FOR [FLD_LOCKHUM]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_I__40C49C62]  DEFAULT ((0)) FOR [FLD_ISBUYCHAR]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_R__41B8C09B]  DEFAULT ('') FOR [FLD_REALACCOUNT]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_L__42ACE4D4]  DEFAULT (NULL) FOR [FLD_LOCKDATE]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_P__43A1090D]  DEFAULT ('') FOR [FLD_PAYORDER]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_S__44952D46]  DEFAULT ((0)) FOR [FLD_STATUS]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_H__4589517F]  DEFAULT ('') FOR [FLD_HEROUSERID]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_H__467D75B8]  DEFAULT ('') FOR [FLD_HERONAME]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_S__4830B400]  DEFAULT ('') FOR [FLD_SECPASSWORD]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  CONSTRAINT [DF__TBL_CHARA__FLD_H__5A4F643B]  DEFAULT ('') FOR [FLD_HumParams]
GO
ALTER TABLE [dbo].[TBL_CHARACTER] ADD  DEFAULT ((0)) FOR [FLD_JVAR]
GO
ALTER TABLE [dbo].[TBL_CONFIG] ADD  DEFAULT ((0)) FOR [Regis]
GO
ALTER TABLE [dbo].[TBL_CONFIG] ADD  DEFAULT ((0)) FOR [iRegCount]
GO
ALTER TABLE [dbo].[TBL_CONFIG] ADD  DEFAULT ('') FOR [sRegionServerName]
GO
ALTER TABLE [dbo].[TBL_CONFIG] ADD  DEFAULT ((0)) FOR [HfCount]
GO
ALTER TABLE [dbo].[TBL_GUILD_INFO] ADD  CONSTRAINT [DF_TBL_GUILD_INFO_Level]  DEFAULT ((0)) FOR [Level]
GO
ALTER TABLE [dbo].[TBL_GUILD_INFO] ADD  CONSTRAINT [DF_TBL_GUILD_INFO_nGold]  DEFAULT ((0)) FOR [nGold]
GO
ALTER TABLE [dbo].[TBL_GUILD_INFO] ADD  CONSTRAINT [DF_TBL_GUILD_INFO_nExp]  DEFAULT ((0)) FOR [nExp]
GO
ALTER TABLE [dbo].[TBL_GUILD_INFO] ADD  CONSTRAINT [DF_TBL_GUILD_INFO_btDeleted]  DEFAULT ((0)) FOR [btDeleted]
GO
ALTER TABLE [dbo].[TBL_GUILD_INFO] ADD  CONSTRAINT [DF_TBL_GUILD_INFO_btAutoJoin]  DEFAULT ((0)) FOR [btAutoJoin]
GO
ALTER TABLE [dbo].[TBL_GUILD_INFO] ADD  CONSTRAINT [DF_TBL_GUILD_INFO_nJoinLevel]  DEFAULT ((0)) FOR [nJoinLevel]
GO
ALTER TABLE [dbo].[TBL_GUILD_INFO] ADD  CONSTRAINT [DF_TBL_GUILD_INFO_nMemberCount]  DEFAULT ((100)) FOR [nMemberCount]
GO
ALTER TABLE [dbo].[TBL_GUILD_MEMBER] ADD  CONSTRAINT [DF_TBL_GUILD_MEMBER_btRank]  DEFAULT ((0)) FOR [btRank]
GO
ALTER TABLE [dbo].[TBL_GUILD_MEMBER] ADD  CONSTRAINT [DF_TBL_GUILD_MEMBER_btJob]  DEFAULT ((0)) FOR [btJob]
GO
ALTER TABLE [dbo].[TBL_GUILD_MEMBER] ADD  CONSTRAINT [DF_TBL_GUILD_MEMBER_btJoin]  DEFAULT ((0)) FOR [btJoin]
GO
ALTER TABLE [dbo].[TBL_GUILD_MEMBER] ADD  CONSTRAINT [DF_TBL_GUILD_MEMBER_nLevel]  DEFAULT ((0)) FOR [nLevel]
GO
ALTER TABLE [dbo].[TBL_GUILD_MEMBER] ADD  DEFAULT ((0)) FOR [btSex]

GO
ALTER TABLE [dbo].[TBL_NET_INFO] ADD  CONSTRAINT [DF_TBL_NET_INFO_nTypeID]  DEFAULT ((0)) FOR [nTypeID]
GO
ALTER TABLE [dbo].[TBL_NET_MEMBER] ADD  CONSTRAINT [DF_TBL_NET_MEMBER_btRank]  DEFAULT ((0)) FOR [btRank]
GO
ALTER TABLE [dbo].[TBL_NET_MEMBER] ADD  CONSTRAINT [DF_TBL_NET_MEMBER_btJob]  DEFAULT ((0)) FOR [btJob]
GO
ALTER TABLE [dbo].[TBL_NET_MEMBER] ADD  CONSTRAINT [DF_TBL_NET_MEMBER_nLevel]  DEFAULT ((0)) FOR [nLevel]
GO
ALTER TABLE [dbo].[TBL_NET_MEMBER] ADD  DEFAULT ((0)) FOR [btSex]

GO
ALTER TABLE [dbo].[TBL_HERO] ADD  CONSTRAINT [DF__TBL_HERO__FLD_DE__0A9D95DB]  DEFAULT ((0)) FOR [FLD_DELETED]
GO
ALTER TABLE [dbo].[TBL_HERO] ADD  CONSTRAINT [DF__TBL_HERO__FLD_HA__0F624AF8]  DEFAULT ((1)) FOR [FLD_HAIR]
GO
ALTER TABLE [dbo].[TBL_HERO] ADD  CONSTRAINT [DF__TBL_HERO__FLD_SE__10566F31]  DEFAULT ((0)) FOR [FLD_SEX]
GO
ALTER TABLE [dbo].[TBL_HERO] ADD  CONSTRAINT [DF__TBL_HERO__FLD_JO__114A936A]  DEFAULT ((0)) FOR [FLD_JOB]
GO
ALTER TABLE [dbo].[TBL_HERO] ADD  CONSTRAINT [DF__TBL_HERO__FLD_LE__123EB7A3]  DEFAULT ((0)) FOR [FLD_LEVEL]
GO
ALTER TABLE [dbo].[TBL_HERO] ADD  CONSTRAINT [DF__TBL_HERO__FLD_HP__1332DBDC]  DEFAULT ((0)) FOR [FLD_HP]
GO
ALTER TABLE [dbo].[TBL_HERO] ADD  CONSTRAINT [DF__TBL_HERO__FLD_MP__14270015]  DEFAULT ((0)) FOR [FLD_MP]
GO
ALTER TABLE [dbo].[TBL_HERO] ADD  CONSTRAINT [DF__TBL_HERO__FLD_EX__151B244E]  DEFAULT ((0)) FOR [FLD_EXP]
GO
ALTER TABLE [dbo].[TBL_HERO] ADD  CONSTRAINT [DF__TBL_HERO__FLD_PK__160F4887]  DEFAULT ((0)) FOR [FLD_PKPOINT]
GO
ALTER TABLE [dbo].[TBL_HERO] ADD  CONSTRAINT [DF__TBL_HERO__FLD_BO__17036CC0]  DEFAULT ((0)) FOR [FLD_BODYLUCK]
GO
ALTER TABLE [dbo].[TBL_HERO] ADD  CONSTRAINT [DF__TBL_HERO__FLD_IN__17F790F9]  DEFAULT ((0)) FOR [FLD_INCHEALTH]
GO
ALTER TABLE [dbo].[TBL_HERO] ADD  CONSTRAINT [DF__TBL_HERO__FLD_IN__18EBB532]  DEFAULT ((0)) FOR [FLD_INCSPELL]
GO
ALTER TABLE [dbo].[TBL_HERO] ADD  CONSTRAINT [DF__TBL_HERO__FLD_IN__19DFD96B]  DEFAULT ((0)) FOR [FLD_INCHEALING]
GO
ALTER TABLE [dbo].[TBL_HERO] ADD  CONSTRAINT [DF__TBL_HERO__FLD_St__1CBC4616]  DEFAULT ((0)) FOR [FLD_StatusTimeArr]
GO
ALTER TABLE [dbo].[TBL_HERO] ADD  CONSTRAINT [DF__TBL_HERO__FLD_RE__1DB06A4F]  DEFAULT ((0)) FOR [FLD_RELEVEL]
GO
ALTER TABLE [dbo].[TBL_HERO] ADD  CONSTRAINT [DF__TBL_HERO__FLD_SY__2DE6D218]  DEFAULT ((0)) FOR [FLD_SYSVAR]
GO
ALTER TABLE [dbo].[TBL_HERO] ADD  CONSTRAINT [DF__TBL_HERO__FLD_SE__367C1819]  DEFAULT ((0)) FOR [FLD_SERVERID]
GO
ALTER TABLE [dbo].[TBL_ITEM_BAG] ADD  CONSTRAINT [DF_TBL_ITEM_BAG_FLD_MAKEINDEX]  DEFAULT (newid()) FOR [FLD_MAKEINDEX]
GO
ALTER TABLE [dbo].[TBL_ITEM_BODY] ADD  CONSTRAINT [DF_TBL_ITEM_BODY_FLD_MAKEINDEX]  DEFAULT (newid()) FOR [FLD_MAKEINDEX]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_M__2739D489]  DEFAULT (newid()) FOR [FLD_MAKEINDEX]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_I__282DF8C2]  DEFAULT ((0)) FOR [FLD_INDEX]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_D__29221CFB]  DEFAULT ((0)) FOR [FLD_DURA]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_D__2A164134]  DEFAULT ((0)) FOR [FLD_DURAMAX]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_B__2B0A656D]  DEFAULT ((0)) FOR [FLD_QUALITY]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_W__2BFE89A6]  DEFAULT ((-1)) FOR [FLD_WHERE]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_O__2CF2ADDF]  DEFAULT ((0)) FOR [FLD_OVERLAP]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_U__2DE6D218]  DEFAULT ('') FOR [FLD_USERID]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_T__2EDAF651]  DEFAULT ((0)) FOR [FLD_TYPE]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_P__2FCF1A8A]  DEFAULT ((0)) FOR [FLD_PRICE]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_A__30C33EC3]  DEFAULT ((0)) FOR [FLD_ADDTIME]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_U__31B762FC]  DEFAULT ('') FOR [FLD_USERLIST]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_J__32AB8735]  DEFAULT ('') FOR [FLD_JOINUSERLIST]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_L__339FAB6E]  DEFAULT ((0)) FOR [FLD_LASTPRICE]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_C__3493CFA7]  DEFAULT ('') FOR [FLD_CURRUSERID]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_P__3587F3E0]  DEFAULT ((0)) FOR [FLD_PAGE]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_L__367C1819]  DEFAULT ((0)) FOR [FLD_LASTTIME]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_F__37703C53]  DEFAULT ((0)) FOR [FLD_FLAG]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_I__3864608B]  DEFAULT ((0)) FOR [FLD_ID]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_U__2DE6D219]  DEFAULT ('') FOR [FLD_GUILDID]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_F__37703C52]  DEFAULT ((90)) FOR [FLD_MEGUILDRATE]
GO
ALTER TABLE [dbo].[TBL_ITEM_PAIMAI] ADD  CONSTRAINT [DF__TBL_ITEM___FLD_L__395884C4]  DEFAULT ((0)) FOR [FLD_LEVEL]
GO
ALTER TABLE [dbo].[TBL_MAGIC] ADD  DEFAULT ((0)) FOR [FLD_LEVEL_UP]
GO
ALTER TABLE [dbo].[TBL_NATION_INFO] ADD  DEFAULT ((0)) FOR [nIdx]
GO
ALTER TABLE [dbo].[TBL_NATION_INFO] ADD  DEFAULT ((0)) FOR [nLevel]
GO
ALTER TABLE [dbo].[TBL_NATION_INFO] ADD  DEFAULT ((0)) FOR [nGold]
GO
ALTER TABLE [dbo].[TBL_NATION_INFO] ADD  DEFAULT ((0)) FOR [nExp]
GO
ALTER TABLE [dbo].[TBL_NATION_INFO] ADD  DEFAULT ((0)) FOR [btDeleted]
GO
ALTER TABLE [dbo].[TBL_NATION_INFO] ADD  DEFAULT ((0)) FOR [nMemberCount]
GO
ALTER TABLE [dbo].[TBL_NATION_INFO] ADD  DEFAULT ((0)) FOR [nAdvValue]
GO
ALTER TABLE [dbo].[TBL_NATION_INFO] ADD  DEFAULT ('') FOR [sRanks]
GO
ALTER TABLE [dbo].[TBL_NATION_INFO] ADD  DEFAULT ((0)) FOR [nServerID]
GO
ALTER TABLE [dbo].[TBL_NATION_MEMBER] ADD  DEFAULT ((0)) FOR [nIdx]
GO
ALTER TABLE [dbo].[TBL_NATION_MEMBER] ADD  DEFAULT ((0)) FOR [sUserID]
GO
ALTER TABLE [dbo].[TBL_NATION_MEMBER] ADD  DEFAULT ((0)) FOR [btRank]
GO
ALTER TABLE [dbo].[TBL_NATION_MEMBER] ADD  DEFAULT ((0)) FOR [btJob]
GO
ALTER TABLE [dbo].[TBL_NATION_MEMBER] ADD  DEFAULT ((0)) FOR [btJoin]
GO
ALTER TABLE [dbo].[TBL_NATION_MEMBER] ADD  DEFAULT ((0)) FOR [nLevel]
GO
ALTER TABLE [dbo].[TBL_NATION_MEMBER] ADD  DEFAULT ((0)) FOR [nAdvValue]
GO
ALTER TABLE [dbo].[TLOG_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_MONEYID]
GO
ALTER TABLE [dbo].[TLOG_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_MONEY]
GO
ALTER TABLE [dbo].[TLOG_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_STATE]
GO
ALTER TABLE [dbo].[TLOG_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_DECSTATE]
GO
ALTER TABLE [dbo].[TLOG_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_GETSTATE]
GO
ALTER TABLE [dbo].[TLOG_BOX_SELL] ADD  DEFAULT ('') FOR [FLD_PAYORDER]
GO
ALTER TABLE [dbo].[TLOG_BOX_SELL] ADD  DEFAULT ((0)) FOR [FLD_STATUS]
GO
/****** Object:  StoredProcedure [dbo].[HERO_INFO_ADD]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[HERO_INFO_ADD]
@MasterUserID VARCHAR(50),
@sChrName VARCHAR(50),
@btSex SMALLINT,
@btJob SMALLINT,
@sUserID VARCHAR(50),
@sServerID VARCHAR(50) = '',
@sMainServerID VARCHAR(50) = '',
@sMasterName VARCHAR(50) = ''
AS
BEGIN
IF EXISTS (SELECT FLD_ID FROM TBL_HERO WHERE (FLD_CHARACTER like @sChrName+'%') or (FLD_CHARACTER like 'S'+@sServerID+'_'+@sChrName+'%') )
   RETURN(1)

  DECLARE @nNum INT
  DECLARE @IsFirstChar INT
  DECLARE @iRegCount INT
  
	SELECT TOP 1 @iRegCount = iRegCount
	FROM dbo.TBL_CONFIG WITH(NOLOCK)
	SET @iRegCount= ISNULL(@iRegCount, 0)

	IF (@iRegCount <> 0) 
	BEGIN
		DECLARE @nTotal INT
		SELECT @nTotal = COUNT(DISTINCT FLD_HEROMASTERUSERID) FROM TBL_HERO WHERE FLD_DELETED = 0;
		IF (@nTotal >= @iRegCount)
			RETURN(7)
	END
	
	 SELECT @nNum = COUNT(*) FROM TBL_HERO WHERE FLD_HEROMASTERUSERID=@MasterUserID AND (FLD_DELETED=0) AND FLD_SERVERID=@sServerID;

	IF @nNum >= 1
		RETURN(3)
		
	IF @nNum >= 1
		SET @IsFirstChar = 0
	ELSE
		SET @IsFirstChar = 1 

	INSERT INTO TBL_HERO
	(
	FLD_HEROMASTERUSERID,
  FLD_USERID,
	FLD_CHARACTER,
	FLD_SEX,
	FLD_JOB,
	FLD_UPDATEDATETIME,
	FLD_MAKEDATE, 
	FLD_SERVERID,
	FLD_MASTERNAME
	)

	VALUES
	(
	@MasterUserID,
  @sUserID,
	@sChrName,
	@btSex,
	@btJob,
	getdate(),
	getdate(),
	@sServerID,
	@sMasterName
	)

	  declare @new_sn bigint
	declare @new_id int
	set @new_id=@@identity

	--本地默认区服ID1
 
	set @new_sn= IIF(CAST(@sMainServerID AS BIGINT)=0,1,CAST(@sMainServerID AS BIGINT)) * POWER(CAST(2 AS BIGINT),32) + NEXT VALUE FOR dbo.SeqIden
		
	update TBL_HERO set FLD_USERID=@new_sn where FLD_ID=@new_id
	set @sUserId = @new_sn

  RETURN(0)
	
END
GO
/****** Object:  StoredProcedure [dbo].[HERO_INFO_UPDATE]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[HERO_INFO_UPDATE]
@sUserID VARCHAR(50),
@sChrName VARCHAR(50),
@Hair SMALLINT,
@Sex SMALLINT,
@Job SMALLINT,
@nLevel INT,
@Hp BIGINT,
@Mp BIGINT,
@Exp BIGINT,
@PkPoint INT,
@BodyLuck FLOAT,
@InChealth INT,
@IncSpell INT,
@IncHealing INT,
@StatusTimeAr binary(24),
@Relevel tinyint,
@MasterName VARCHAR(50),
@Sysvar binary(400),
@Abil VARBINARY(MAX),
@WAbil VARBINARY(MAX),
@Feathure VARCHAR(200),
@sHumParams VARCHAR(Max)
AS
IF EXISTS(SELECT FLD_ID FROM TBL_HERO WHERE FLD_USERID=@sUserID)
BEGIN
  UPDATE TBL_HERO SET
    FLD_UPDATEDATETIME = getdate(),
	FLD_CHARACTER = @sChrName,
	FLD_HAIR = @Hair,
	FLD_SEX = @Sex,
	FLD_JOB = @Job,
	FLD_LEVEL = @nLevel,
	FLD_HP = @Hp,
	FLD_MP = @Mp,
	FLD_EXP = @Exp,
	FLD_PKPOINT = @PkPoint,
	FLD_BODYLUCK = @BodyLuck,
	FLD_INCHEALTH = @InChealth,
	FLD_INCSPELL = @IncSpell,
	FLD_INCHEALING = @IncHealing,
	FLD_StatusTimeArr = @StatusTimeAr,
	FLD_RELEVEL = @Relevel,
	FLD_MASTERNAME = @MasterName,
	FLD_SYSVAR = @Sysvar,
	FLD_Abil=@Abil,
	FLD_AbilMax=@WAbil,
	FLD_FEATURE = @Feathure,
	FLD_HumParams=@sHumParams
  WHERE FLD_USERID=@sUserID
	Return(0)
END
ELSE 
  RETURN(1)
GO
/****** Object:  StoredProcedure [dbo].[HUM_INFO_ADD]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[HUM_INFO_ADD]
@sAccount VARCHAR(128),
@sChrName VARCHAR(50),
@btSex SMALLINT,
@btJob SMALLINT,
@sUserID VARCHAR(50),
@sSdkId VARCHAR(50) = '',
@sServerID VARCHAR(50) = '',
@sMainServerID VARCHAR(50) = '',
@sHeroName VARCHAR(50) = '',
@sHeroID VARCHAR(50) = '',
@bWhite BIT = 0
AS
BEGIN
IF EXISTS (SELECT FLD_ID FROM TBL_CHARACTER WHERE (FLD_CHARACTER like @sChrName+'%') or (FLD_CHARACTER like 'S'+@sServerID+'_'+@sChrName+'%') )
   RETURN(1)

  DECLARE @nNum INT
  DECLARE @IsFirstChar INT
  DECLARE @iRegCount INT
  DECLARE @iRegis INT
  DECLARE @tStartTime DATETIME
  DECLARE @tDisableTime DATETIME
  DECLARE @DisableHFCount INT=0
  DECLARE @HFCount INT=0
  
	SELECT TOP 1 @iRegCount = iRegCount,@iRegis=Regis,@tStartTime=StartTime,@tDisableTime=DisableTime,@DisableHFCount=ISNULL(DisableHFCount,0),@HFCount=ISNULL(HfCount,0)
	FROM dbo.TBL_CONFIG WITH(NOLOCK)
	SET @iRegCount= ISNULL(@iRegCount, 0)
	SET @iRegis= ISNULL(@iRegis, 0)

	IF @DisableHFCount>0 AND @HFCount>=@DisableHFCount AND @bWhite=0
	BEGIN
		RETURN(7)
	END

	IF @tDisableTime IS NOT NULL AND GETDATE() > @tDisableTime and @bWhite=0
	BEGIN
		RETURN(7)
	END

	IF (@iRegis > 0) AND (@tStartTime IS NOT NULL) AND (@bWhite=0)
	BEGIN
		IF DATEDIFF(DAY,@tStartTime,GETDATE()) > @iRegis
			RETURN(7)
	END

	IF (@iRegCount <> 0)  AND (@bWhite=0)
	BEGIN
		DECLARE @nTotal INT
		SELECT @nTotal = COUNT(DISTINCT FLD_ACCOUNT) FROM TBL_CHARACTER WHERE FLD_DELETED = 0;
		IF (@nTotal >= @iRegCount)
			RETURN(7)
	END
	
	 SELECT @nNum = COUNT(*) FROM TBL_CHARACTER WHERE FLD_ACCOUNT=@sAccount AND (FLD_DELETED=0) AND FLD_SERVERID=@sServerID
	 
	IF @nNum >= 6
		RETURN(3)
		
	IF @nNum >= 1
		SET @IsFirstChar = 0
	ELSE
		SET @IsFirstChar = 1 

	INSERT INTO TBL_CHARACTER
	(
  FLD_USERID,
	FLD_CHARACTER,
	FLD_ACCOUNT,
	FLD_SEX,
	FLD_JOB,
	FLD_UPDATEDATETIME,
	FLD_MAKEDATE, 
	FLD_ISFIRSTCHAR, 
	FLD_MAPNAME,
	FLD_HOMEMAP,
	FLD_SDKID,
	FLD_SERVERID,
	FLD_HEROUSERID,
	FLD_HERONAME,
	FLD_VARCLEARTIME
	)

	VALUES
	(
	@sUserID,
	@sChrName,
	@sAccount,
	@btSex,
	@btJob,
	GETDATE(),
	GETDATE(),
	@IsFirstChar,
	'',
	'',
	@sSdkId,
	@sServerID,
	@sHeroID,
	@sHeroName,
	GETDATE()
	)

  DECLARE @new_sn BIGINT
	DECLARE @new_id INT
	SET @new_id=@@identity

	--本地默认区服ID1
	SET @new_sn= IIF(CAST(@sMainServerID AS BIGINT)=0,1,CAST(@sMainServerID AS BIGINT)) * POWER(CAST(2 AS BIGINT),32) + NEXT VALUE FOR dbo.SeqIden
		
	UPDATE TBL_CHARACTER SET FLD_USERID=@new_sn WHERE FLD_ID=@new_id
	SET @sUserId = @new_sn

  RETURN(0)
	
END
GO
/****** Object:  StoredProcedure [dbo].[HUM_INFO_UPDATE]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[HUM_INFO_UPDATE]
@sUserID VARCHAR(50),
@sChrName VARCHAR(50),
@MapName VARCHAR(50),
@Cx SMALLINT,
@Cy SMALLINT,
@Dir int,
@Hair SMALLINT,
@Sex SMALLINT,
@Job SMALLINT,
@nLevel INT,
@Hp BIGINT,
@Mp BIGINT,
@Exp BIGINT,
@sHomeMap VARCHAR(50),
@Hx SMALLINT,
@Hy SMALLINT,
@PkPoint INT,
@btF9 INT,
@AttackMode BIGINT,
@FightZoneDie tinyint,
@BodyLuck FLOAT,
@InChealth INT,
@IncSpell INT,
@IncHealing INT,
@BonusPoint INT,
@StatusTimeAr binary(24),
@GameGold BIGINT,
@MasterName VARCHAR(50),
@Master tinyint,
@DearName VARCHAR(50),
@StoragePwd VARCHAR(10),
@LockLogon tinyint,
@QuestFlag binary(128),
@Money binary(800),
@MarryCount INT,
@Ee tinyint,
@Sysvar binary(400),
@uvar varbinary(max),
@Feathure VARCHAR(200),
@SuckDamageCount INT,
@SuckDamageBiLi INT,
@SuckDamageRate tinyint,
@sHeroName VARCHAR(50),
@sHeroUid VARCHAR(50),
@tClearVarTime datetime,
@jVar binary(2000),
@sSecPassWord VARCHAR(55),
@Abil VARBINARY(MAX),
@WAbil VARBINARY(MAX),
@BonusAbil binary(80),
@BonusAdjust binary(2040),
@NetState BIGINT,
@NetCall BIGINT,
@DC BIGINT,
@sHumParams VARCHAR(MAX)
AS
IF EXISTS(SELECT FLD_ID FROM TBL_CHARACTER WHERE FLD_USERID=@sUserID)
BEGIN
  UPDATE TBL_CHARACTER SET
  FLD_UPDATEDATETIME = getdate(),
  FLD_CHARACTER = @sChrName,
  FLD_MAPNAME = @MapName,
  FLD_CX = @Cx,
  FLD_CY = @Cy,
	FLD_DIR = @Dir,
  FLD_HAIR = @Hair,
	FLD_SEX = @Sex,
  FLD_JOB = @Job,
  FLD_LEVEL = @nLevel,
	FLD_HOMEMAP = @sHomeMap,
  FLD_HOMEX = @Hx,
	FLD_HOMEY	= @Hy,
  FLD_BTF9 = @btF9,
	FLD_ATTACKMODE = @AttackMode,
	FLD_FIGHTZONEDIE = @FightZoneDie,
	FLD_INCHEALTH = @InChealth,
	FLD_INCSPELL = @IncSpell,
	FLD_INCHEALING = @IncHealing,
	FLD_BONUSPOINT = @BonusPoint,
	FLD_GAMEGOLD = @GameGold,
	FLD_MASTERNAME = @MasterName,
	FLD_MASTER = @Master,
	FLD_DEARNAME = @DearName,
	FLD_LOCKLOGON = @LockLogon,
	FLD_QUESTFLAG = @QuestFlag,
  FLD_MONEY = @Money,
	FLD_MARRYCOUNT = @MarryCount,
	FLD_EE = @Ee,
  FLD_SYSVAR = @Sysvar,
  FLD_UVAR = @uvar,
  FLD_FEATURE = @Feathure,
	FLD_SUCKDAMAGECOUNT = @SuckDamageCount,
	FLD_SUCKDAMAGERATE = @SuckDamageRate,
	FLD_SUCKDAMAGEBILI = @SuckDamageBiLi,
	FLD_DC = @Dc,
	FLD_HERONAME = @sHeroName,
	FLD_HEROUSERID = @sHeroUid,
	FLD_JVAR = @jVar,
	FLD_VARCLEARTIME = @tClearVarTime,
	FLD_SECPASSWORD = [REDACTED]
	FLD_Abil=@Abil,
	FLD_AbilMax=@WAbil,
	FLD_BonusAbil=@BonusAbil,
	FLD_BonusAdjust=@BonusAdjust,
	FLD_NETSTATE=@NetState,
	FLD_NETCALL=@NetCall,
	FLD_HumParams = @sHumParams
  WHERE FLD_USERID=@sUserID
	Return(0)
END
ELSE 
  RETURN(1)
GO
/****** Object:  StoredProcedure [dbo].[LoadItemVar]    Script Date: 2024/7/24 14:49:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[LoadItemVar]
@sUserID VARCHAR(50),
@iType int= 0
AS
BEGIN  
	IF @iType=0 
	BEGIN
		SELECT FLD_MAKEINDEX, FLD_TYPE, FLD_VAR_NAME, FLD_INTVALUE, FLD_STRVALUE, tUpdateTime, tClear FROM TBL_VAR_ITEM WITH(NOLOCK)
		WHERE FLD_MAKEINDEX IN (
		SELECT FLD_MAKEINDEX FROM DBO.TBL_ITEM_BAG A1 WITH(NOLOCK) WHERE A1.FLD_USERID=@sUserID
		UNION SELECT FLD_MAKEINDEX FROM DBO.TBL_ITEM_BODY A1 WITH(NOLOCK) WHERE A1.FLD_USERID=@sUserID
		UNION SELECT FLD_MAKEINDEX FROM DBO.TBL_ITEM_STORAGE A1 WITH(NOLOCK) WHERE A1.FLD_USERID=@sUserID
		UNION SELECT FLD_MAKEINDEX FROM DBO.TBL_ITEM_PAIMAI A1 WITH(NOLOCK) WHERE A1.FLD_USERID=@sUserID)
		ORDER BY FLD_MAKEINDEX
	END
	ELSE IF @iType=1 
	BEGIN
		SELECT FLD_MAKEINDEX, FLD_TYPE, FLD_VAR_NAME, FLD_INTVALUE, FLD_STRVALUE, tUpdateTime, tClear FROM TBL_VAR_ITEM WITH(NOLOCK)
		WHERE FLD_MAKEINDEX IN (
		SELECT FLD_MAKEINDEX FROM DBO.TBL_HERO_BODY A1 WITH(NOLOCK) WHERE A1.FLD_USERID=@sUserID
		UNION SELECT FLD_MAKEINDEX FROM DBO.TBL_HERO_BAG A1 WITH(NOLOCK) WHERE A1.FLD_USERID=@sUserID)
		ORDER BY FLD_MAKEINDEX
	END
	ELSE IF @iType=2
	BEGIN
		SELECT FLD_MAKEINDEX, FLD_TYPE, FLD_VAR_NAME, FLD_INTVALUE, FLD_STRVALUE, tUpdateTime, tClear FROM TBL_VAR_ITEM WITH(NOLOCK)
		WHERE FLD_MAKEINDEX IN (
		SELECT FLD_MAKEINDEX FROM DBO.TBL_ITEM_GUILD_STORAGE A1 WITH(NOLOCK) WHERE A1.FLD_GUILDID=@sUserID)
		ORDER BY FLD_MAKEINDEX
	END	
END
GO

-- -----------------宠物表存储过程-----------------
CREATE PROCEDURE [dbo].[PET_INFO_UPDATE]
@nUserID bigint,
@nMasterUserID bigint,
@nPetIdx INT,
@sPetName VARCHAR(50),
@Abil VARBINARY(MAX),
@StatusTimeArr binary(24),
@sBodyItem varchar(200) = '',
@nState int = 0,
@nDelete tinyint = 0
AS
BEGIN
	IF (EXISTS(SELECT FLD_ID FROM TBL_Pet WHERE FLD_USERID=@nUserID))
	BEGIN
		UPDATE TBL_PET SET
			FLD_MASTERUSERID= @nMasterUserID,
			FLD_PETIDX = @nPetIdx,
			FLD_PETNAME = @sPetName,
			FLD_Abil = @Abil,
			FLD_StatusTimeArr = @StatusTimeArr,
			FLD_Bodyitem	= @sBodyItem,
			FLD_STATE =@nState,
			FLD_UPDATEDATETIME = getdate(),
			FLD_DELETED= @nDelete
		WHERE FLD_USERID=@nUserID	
		Return 0
	END
	ELSE
	BEGIN
		INSERT INTO TBL_PET
		(
		FLD_MASTERUSERID,
		FLD_USERID,
		FLD_PETNAME,
		FLD_PETIDX,
		FLD_Abil,
		FLD_StatusTimeArr,
		FLD_BODYITEM,
		FLD_MAKEDATE, 
		FLD_UPDATEDATETIME,
		FLD_STATE
		)
		VALUES
		(
		@nMasterUserID,
		@nUserID,
		@sPetName,
		@nPetIdx,
		@Abil,
		@StatusTimeArr,
		@sBodyItem,
		getdate(),
		getdate(),
		@nState
		)
		Return 0
	END
END
