CREATE TABLE [NBB_Award] (
	[award_id] [int] IDENTITY (1, 1) NOT NULL ,
	[award_info] [varchar] (250) NULL ,
	[item_slg] [tinyint] NOT NULL DEFAULT (1) ,
	[item_name] [nvarchar](MAX) NOT NULL ,
	[item_code] [varchar] (32) NOT NULL ,
	[item_info] [nvarchar](MAX) NULL ,
	[item_image] [varchar] (20) NULL ,
	[seri_block] [tinyint] NOT NULL DEFAULT (0),
	[acc] [varchar] (10) NOT NULL ,
	[name] [varchar] (10) NOT NULL ,
	[status] [tinyint] NOT NULL DEFAULT (0),	-- 0: Chua nhan, 1: Da nhan
	[create_time] [int] NULL,
	[receive_time] [int] NULL,
	[hsd_time] [int] NULL,
	[thuhoi] [tinyint] NULL
) ON [PRIMARY]
PRINT 'Tao bang NBB_Award thanh cong'
GO

CREATE TABLE [dbo].[GiaiTri_LoDe] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[Account] [varchar] (10) COLLATE Latin1_General_CI_AS NULL ,
	[Num_Bet1] [varchar] (2) COLLATE Latin1_General_CI_AS NULL ,
	[Num_Bet2] [varchar] (2) COLLATE Latin1_General_CI_AS NULL ,
	[Num_Bet3] [varchar] (2) COLLATE Latin1_General_CI_AS NULL ,
	[Num_Bet4] [varchar] (2) COLLATE Latin1_General_CI_AS NULL ,
	[Num_Point] [int] NOT NULL ,
	[Type_play] [varchar] (7) COLLATE Latin1_General_CI_AS NULL ,
	[Type_MoneyBet] [varchar] (6) COLLATE Latin1_General_CI_AS NULL ,
	[Date_Bet] [varchar] (10) COLLATE Latin1_General_CI_AS NULL ,
	[Bet_Status] [tinyint] NULL 
) ON [PRIMARY]
PRINT 'Tao bang GiaiTri_LoDe thanh cong'
GO

CREATE TABLE [dbo].[ShareFB_VWEB] (
	[acc] [varchar] (10) COLLATE Latin1_General_CS_AS NOT NULL ,
	[phanthuong] [nvarchar] (250) COLLATE Latin1_General_CI_AS NULL ,
	[Des] [ntext] COLLATE Latin1_General_CI_AS NULL ,
	[time] [int] NULL ,
	[fbid] [nvarchar] (50) COLLATE Latin1_General_CI_AS NULL ,
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
PRINT 'Tao bang ShareFB_VWEB thanh cong'
GO

CREATE TABLE [dbo].[EVENT_TONGTOP_VWEB] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[acc] [varchar] (20) COLLATE Latin1_General_CS_AS NULL ,
	[name] [varchar] (20) COLLATE Latin1_General_CI_AS NULL ,
	[resets] [int] NOT NULL ,
	[card] [bigint] NOT NULL ,
	[time] [smalldatetime] NOT NULL 
) ON [PRIMARY]
PRINT 'Tao bang EVENT_TONGTOP_VWEB thanh cong'
GO

CREATE TABLE [dbo].[EVENT_TONGTOP_VWEB_KETQUA] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[acc] [varchar] (20) COLLATE Latin1_General_CS_AS NULL ,
	[name] [varchar] (20) COLLATE Latin1_General_CI_AS NULL ,
	[resets] [int] NOT NULL ,
	[card] [bigint] NOT NULL ,
	[top_resets] [int] NOT NULL ,
	[top_card] [int] NOT NULL ,
	[TongTop] [int] NOT NULL ,
) ON [PRIMARY]
PRINT 'Tao bang EVENT_TONGTOP_VWEB_KETQUA thanh cong'
GO

CREATE TABLE [dbo].[event_doiitem_vweb] (
	[acc] [varchar] (10) COLLATE Latin1_General_CS_AS NOT NULL ,
	[name] [varchar] (10) COLLATE Latin1_General_CI_AS NULL ,
	[itemtype] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
	[seri] [varchar] (8) COLLATE Latin1_General_CI_AS NOT NULL ,
	[value] [int] NOT NULL ,
	[time] [int] NULL 
) ON [PRIMARY]
PRINT 'Tao bang event_doiitem_vweb thanh cong'
GO

CREATE TABLE [dbo].[Log_ModVweb] (
	[acc] [varchar] (10) COLLATE Latin1_General_CS_AS NOT NULL ,
	[Des] [ntext] COLLATE Latin1_General_CI_AS NULL ,
	[time] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
PRINT 'Tao bang Log_ModVweb thanh cong'
GO

CREATE TABLE [vweb_block] (
	[admin] [varchar] (50) NOT NULL ,
	[acc] [varchar] (10) NOT NULL ,
	[block_type] [tinyint] NOT NULL DEFAULT(0) ,
	[block_des] [varchar] (250) NOT NULL ,
	[day_block] [int] NOT NULL DEFAULT(0) ,
	[block_time_begin] [int] NOT NULL DEFAULT(0) ,
	[block_time_end] [int] NULL
) ON [PRIMARY]
PRINT 'Tao bang vweb_block thanh cong'
GO

CREATE TABLE [dbo].[vweb_warehouse_safe] (
		[id] [int] IDENTITY (1, 1) NOT NULL ,
		[acc] [varchar] (10) NOT NULL ,
		[item_code] [varchar] (32) NOT NULL ,
		[item_name] [ntext] NOT NULL ,
		[item_info] [ntext] NULL ,
		[item_serial] [varchar] (8) NOT NULL ,
		[item_image] [varchar] (20) NOT NULL ,
		[time_gui] [int] NOT NULL DEFAULT(0),
		[time_rut] [int] NOT NULL DEFAULT(0),
		[status] [tinyint] NOT NULL DEFAULT(0)				-- 0 : dang trong Warehouse Secure, 1 : Da rut ra
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
PRINT 'Tao bang vweb_warehouse_safe thanh cong'
GO

CREATE TABLE [dbo].[JBKhoa_VWebMU](
	[acc] [varchar](10) NOT NULL,
	[landao] [int] NOT NULL,
	[year] [int] NOT NULL,
	[month] [tinyint] NOT NULL,
	[day] [tinyint] NOT NULL,
	[time] [int] NOT NULL
) ON [PRIMARY]
PRINT 'Tao bang JBKhoa_VWebMU thanh cong'
GO

CREATE TABLE [DauGia_Bid] (
	[bid_id] [int] NOT NULL ,
	[acc] [varchar] (10) NOT NULL ,
	[name] [varchar] (10) NOT NULL ,
	[bid_gcoin] [bigint] NOT NULL DEFAULT (0) ,
	[bid_time] [int] NOT NULL DEFAULT (0) ,
	[status] [tinyint] NOT NULL DEFAULT (1)
) ON [PRIMARY]
PRINT 'Tao bang DauGia_Bid thanh cong'
GO

CREATE TABLE [DauGiaNguoc_Bid] (
	[bid_id] [int] NOT NULL ,
	[acc] [varchar] (10) NOT NULL ,
	[name] [varchar] (10) NOT NULL ,
	[bid_gcoin] [bigint] NOT NULL DEFAULT (0) ,
	[bid_time] [int] NOT NULL DEFAULT (0) ,
	[win] [tinyint] NOT NULL DEFAULT (0)
) ON [PRIMARY]
PRINT 'Tao bang DauGiaNguoc_Bid thanh cong'
GO

CREATE TABLE [dbo].[vweb_muathe] (
	[stt] [int] IDENTITY(1,1) NOT NULL,
	[acc] [varchar] (10) COLLATE Latin1_General_CI_AS NOT NULL ,
	[sdt] [varchar] (20) COLLATE Latin1_General_CI_AS NOT NULL ,
	[loaithe] [varchar] (10) COLLATE Latin1_General_CI_AS NOT NULL ,
	[menhgia] [int] NOT NULL ,
	[soluong] [int] NOT NULL ,
	[status] [int] NOT NULL ,
	[time] [int] NOT NULL 
) ON [PRIMARY]
PRINT 'Tao bang vweb_muathe thanh cong'
GO

CREATE TABLE [vweb_gift_tichluythe] (
	[acc] [varchar] (10) NOT NULL ,
	[tongthe] [int] NOT NULL DEFAULT(0) ,
	[time] [int] NOT NULL DEFAULT(0)
) ON [PRIMARY]
PRINT 'Tao bang vweb_gift_tichluythe thanh cong'
GO

CREATE TABLE [dbo].[vweb_doingoc] (
		[id] [int] IDENTITY (1, 1) NOT NULL ,
		[acc] [varchar] (10) NOT NULL ,
		[item_code] [varchar] (32) NOT NULL ,
		[item_name] [ntext] NOT NULL ,
		[item_info] [ntext] NULL ,
		[item_serial] [varchar] (8) NOT NULL ,
		[item_image] [varchar] (20) NOT NULL ,
		[giaban] [int] NOT NULL DEFAULT(0),
		[tiente] [varchar] (10) NOT NULL ,
		[time] [int] NOT NULL DEFAULT(0)
) ON [PRIMARY]
PRINT 'Tao bang vweb_doingoc thanh cong'
GO

CREATE TABLE [dbo].[VWEB_Resets_Log] (
	[AccountID] [varchar](10) NOT NULL,
	[Name] [varchar](50) NOT NULL,
	[Relife] [int] NOT NULL,
	[Resets] [int] NOT NULL,
	[Time] [int] NOT NULL
) ON [PRIMARY]
PRINT 'Tao bang vweb_doingoc thanh cong'
GO

CREATE TABLE [VWeb_DaiLy] (
	[acc] [varchar] (10) NOT NULL,
	[gcoin_daily]	[bigint] DEFAULT (0)
) ON [PRIMARY]
PRINT 'Tao bang VWeb_DaiLy thanh cong'
GO

CREATE TABLE [dbo].[Log_ModDaiLy] (
	[acc] [varchar] (10) NOT NULL ,
	[Des] [ntext] NULL ,
	[time] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
PRINT 'Tao bang Log_ModDaiLy thanh cong'
GO

CREATE TABLE [VWEB_Items2Point] (
	[acc] [varchar] (20) NULL ,
	[name] [varchar] (20) NULL ,
	[points] [int] NOT NULL DEFAULT (0) ,
	[slg] [int] NOT NULL DEFAULT (0) ,
	[type] [tinyint] NOT NULL DEFAULT (1) ,
	[time] [smalldatetime] NOT NULL DEFAULT (2013-01-01)
) ON [PRIMARY]
PRINT 'Tao bang VWEB_Items2Point thanh cong'
GO

CREATE TABLE [Event_TOP_Master2Point] (
	[acc] [varchar] (20) NULL ,
	[name] [varchar] (20) NULL ,
	[points] [int] NOT NULL DEFAULT (0) ,
	[time] [smalldatetime] NOT NULL DEFAULT (2013-01-01)
) ON [PRIMARY]
PRINT 'Tao bang Event_TOP_Master2Point thanh cong'
GO

CREATE TABLE [dbo].[VWEB_PointEvent_Log] (
	[acc] [varchar](10) NOT NULL,
	[name] [varchar](50) NOT NULL,
	[point_event] [int] NOT NULL,
	[Time] [int] NOT NULL
) ON [PRIMARY]
PRINT 'Tao bang VWEB_PointEvent_Log thanh cong'
GO

CREATE TABLE [dbo].[VWEB_DanhHieuThue_Log] (
	[acc] [varchar](10) NOT NULL,
	[name] [varchar](50) NOT NULL,
	[lop] [varchar](50) NOT NULL,
	[id] [int] NOT NULL,
	[Time] [int] NOT NULL
) ON [PRIMARY]
PRINT 'Tao bang VWEB_DanhHieuThue_Log thanh cong'
GO

CREATE TABLE [vweb_gift_thangcap] (
	[acc] [varchar] (10) NOT NULL ,
	[name] [varchar] (10) NOT NULL ,
	[reset_all] [int] NOT NULL DEFAULT(0) ,
	[relife] [int] NOT NULL DEFAULT(0) ,
	[reset] [int] NOT NULL DEFAULT(0) ,
	[level] [int] NOT NULL DEFAULT(0) ,
	[time] [int] NOT NULL DEFAULT(0)
) ON [PRIMARY]
PRINT 'Tao bang vweb_gift_thangcap thanh cong'
GO

CREATE TABLE [Event_TOP_TieuPhi] (
	[acc] [varchar] (20) NULL ,
	[name] [varchar] (20) NULL ,
	[gcoin] [int] NOT NULL DEFAULT (0) ,
	[gcoin_km] [int] NOT NULL DEFAULT (0) ,
	[vpoint] [int] NOT NULL DEFAULT (0) ,
	[time] [smalldatetime] NOT NULL DEFAULT (2013-01-01)
) ON [PRIMARY]
PRINT 'Tao bang Event_TOP_TieuPhi thanh cong'
GO

CREATE TABLE [Event_TOP_VongQuay] (
	[acc] [varchar] (10) NOT NULL ,
	[lanquay] [int] NOT NULL DEFAULT(0) ,
	[time] [smalldatetime] NOT NULL DEFAULT (2013-01-01)
) ON [PRIMARY]
PRINT 'Tao bang Event_TOP_VongQuay thanh cong'
GO
IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='DauGia_Bid' AND COLUMN_NAME='bid_gcoin' )
BEGIN 
	Alter TABLE DauGia_Bid ADD bid_gcoin bigint NOT NULL DEFAULT (0)
	PRINT 'Da them cot DauGia_Bid.bid_gcoin'
END
ELSE BEGIN PRINT 'Da co cot DauGia_Bid.bid_gcoin' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='DauGiaNguoc_Bid' AND COLUMN_NAME='bid_gcoin' )
BEGIN 
	Alter TABLE DauGiaNguoc_Bid ADD bid_gcoin bigint NOT NULL DEFAULT (0)
	PRINT 'Da them cot DauGiaNguoc_Bid.bid_gcoin'
END
ELSE BEGIN PRINT 'Da co cot DauGiaNguoc_Bid.bid_gcoin' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='JBKhoa_VWebMU' AND COLUMN_NAME='landao' )
BEGIN 
	Alter TABLE JBKhoa_VWebMU ADD landao int NOT NULL DEFAULT (0)
	PRINT 'Da them cot JBKhoa_VWebMU.landao'
END
ELSE BEGIN PRINT 'Da co cot JBKhoa_VWebMU.landao' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='JBKhoa_VWebMU' AND COLUMN_NAME='year' )
BEGIN 
	ALTER TABLE [dbo].[JBKhoa_VWebMU] ADD  DEFAULT ((2016)) FOR [year]
	PRINT 'Da them cot JBKhoa_VWebMU.year'
END
ELSE BEGIN PRINT 'Da co cot JBKhoa_VWebMU.year' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='JBKhoa_VWebMU' AND COLUMN_NAME='month' )
BEGIN 
	ALTER TABLE [dbo].[JBKhoa_VWebMU] ADD  DEFAULT ((1)) FOR [month]
	PRINT 'Da them cot JBKhoa_VWebMU.month'
END
ELSE BEGIN PRINT 'Da co cot JBKhoa_VWebMU.month' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='JBKhoa_VWebMU' AND COLUMN_NAME='day' )
BEGIN 
	ALTER TABLE [dbo].[JBKhoa_VWebMU] ADD  DEFAULT ((1)) FOR [day]
	PRINT 'Da them cot JBKhoa_VWebMU.day'
END
ELSE BEGIN PRINT 'Da co cot JBKhoa_VWebMU.day' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='JBKhoa_VWebMU' AND COLUMN_NAME='time' )
BEGIN 
	ALTER TABLE [dbo].[JBKhoa_VWebMU] ADD  DEFAULT ((0)) FOR [time]
	PRINT 'Da them cot JBKhoa_VWebMU.time'
END
ELSE BEGIN PRINT 'Da co cot JBKhoa_VWebMU.time' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='MEMB_INFO' AND COLUMN_NAME='JBKhoa' )
BEGIN 
	Alter TABLE MEMB_INFO ADD JBKhoa int NOT NULL DEFAULT (0)
	PRINT 'Da them cot MEMB_INFO.JBKhoa'
END
ELSE BEGIN PRINT 'Da co cot MEMB_INFO.JBKhoa' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='MEMB_INFO' AND COLUMN_NAME='vweb_warehouse_safe_extra' )
BEGIN 
	Alter TABLE MEMB_INFO ADD vweb_warehouse_safe_extra int NOT NULL DEFAULT (0)
	PRINT 'Da them cot MEMB_INFO.vweb_warehouse_safe_extra'
END
ELSE BEGIN PRINT 'Da co cot MEMB_INFO.vweb_warehouse_safe_extra' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='Character' AND COLUMN_NAME='Resets_Time_0h' )
BEGIN 
	Alter TABLE Character ADD Resets_Time_0h int NOT NULL DEFAULT (0)
	PRINT 'Da them cot Character.Resets_Time_0h'
END
ELSE BEGIN PRINT 'Da co cot Character.Resets_Time_0h' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='MEMB_INFO' AND COLUMN_NAME='baoveaccip' )
BEGIN 
	Alter TABLE MEMB_INFO ADD baoveaccip varchar (15) NOT NULL DEFAULT (0)
	PRINT 'Da them cot MEMB_INFO.baoveaccip'
END
ELSE BEGIN PRINT 'Da co cot MEMB_INFO.baoveaccip' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='memb_info' AND COLUMN_NAME='LanQuayItem' )
BEGIN 
	Alter TABLE memb_info ADD LanQuayItem int NOT NULL DEFAULT (0)
	PRINT 'Da them cot memb_info.LanQuayItem'
END
ELSE BEGIN PRINT 'Da co cot memb_info.LanQuayItem' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='memb_info' AND COLUMN_NAME='GHRS_VongQuay' )
BEGIN 
	Alter TABLE memb_info ADD GHRS_VongQuay int NOT NULL DEFAULT (0)
	PRINT 'Da them cot memb_info.GHRS_VongQuay'
END
ELSE BEGIN PRINT 'Da co cot memb_info.GHRS_VongQuay' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='Character' AND COLUMN_NAME='master2point' )
BEGIN 
	Alter TABLE Character ADD master2point int NOT NULL DEFAULT (0)
	PRINT 'Da them cot Character.master2point'
END
ELSE BEGIN PRINT 'Da co cot Character.master2point' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='MEMB_INFO' AND COLUMN_NAME='vipvweb' )
BEGIN 
	Alter TABLE MEMB_INFO ADD vipvweb int NOT NULL DEFAULT (0)
	PRINT 'Da them cot MEMB_INFO.vipvweb'
END
ELSE BEGIN PRINT 'Da co cot MEMB_INFO.vipvweb' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='MEMB_INFO' AND COLUMN_NAME='kimcuongvweb' )
BEGIN 
	Alter TABLE MEMB_INFO ADD kimcuongvweb int NOT NULL DEFAULT (0)
	PRINT 'Da them cot MEMB_INFO.kimcuongvweb'
END
ELSE BEGIN PRINT 'Da co cot MEMB_INFO.kimcuongvweb' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='TopReset' AND COLUMN_NAME='reset_uythac' )
BEGIN 
	Alter TABLE TopReset ADD reset_uythac int NOT NULL DEFAULT 0
	PRINT 'Da them cot TopReset.reset_uythac'
END
ELSE BEGIN PRINT 'Da co cot TopReset.reset_uythac' END

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='Character' AND COLUMN_NAME='vweb_pointsave_str' )
BEGIN 
	Alter TABLE Character ADD vweb_pointsave_str int NOT NULL DEFAULT (0)
	PRINT 'Da them cot Character.vweb_pointsave_str'
END
ELSE BEGIN PRINT 'Da co cot Character.vweb_pointsave_str' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='Character' AND COLUMN_NAME='vweb_pointsave_agi' )
BEGIN 
	Alter TABLE Character ADD vweb_pointsave_agi int NOT NULL DEFAULT (0)
	PRINT 'Da them cot Character.vweb_pointsave_agi'
END
ELSE BEGIN PRINT 'Da co cot Character.vweb_pointsave_agi' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='Character' AND COLUMN_NAME='vweb_pointsave_vit' )
BEGIN 
	Alter TABLE Character ADD vweb_pointsave_vit int NOT NULL DEFAULT (0)
	PRINT 'Da them cot Character.vweb_pointsave_vit'
END
ELSE BEGIN PRINT 'Da co cot Character.vweb_pointsave_vit' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='Character' AND COLUMN_NAME='vweb_pointsave_ene' )
BEGIN 
	Alter TABLE Character ADD vweb_pointsave_ene int NOT NULL DEFAULT (0)
	PRINT 'Da them cot Character.vweb_pointsave_ene'
END
ELSE BEGIN PRINT 'Da co cot Character.vweb_pointsave_ene' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='GiftCode' AND COLUMN_NAME='acc' )
BEGIN 
	Alter TABLE GiftCode ADD acc [varchar] (10) NULL
	PRINT 'Da them cot GiftCode.acc'
END
ELSE BEGIN PRINT 'Da co cot GiftCode.acc' END

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='GiftCode' AND COLUMN_NAME='giftcode_type' )
BEGIN 
	Alter TABLE GiftCode ADD giftcode_type tinyint NULL
	PRINT 'Da them cot GiftCode.giftcode_type'
END
ELSE BEGIN PRINT 'Da co cot GiftCode.giftcode_type' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='MEMB_INFO' AND COLUMN_NAME='vipvweb_type' )
BEGIN 
	Alter TABLE MEMB_INFO ADD vipvweb_type int NOT NULL DEFAULT (0)
	PRINT 'Da them cot MEMB_INFO.vipvweb_type'
END
ELSE BEGIN PRINT 'Da co cot MEMB_INFO.vipvweb_type' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='MEMB_INFO' AND COLUMN_NAME='jewel_hhht' )
BEGIN 
	Alter TABLE MEMB_INFO ADD jewel_hhht int NOT NULL DEFAULT 0
	PRINT 'Da them cot MEMB_INFO.jewel_hhht'
END
ELSE BEGIN PRINT 'Da co cot MEMB_INFO.jewel_hhht' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='CardPhone' AND COLUMN_NAME='transaction_code' )
BEGIN 
	Alter TABLE CardPhone ADD transaction_code char(36) NULL DEFAULT 0
	PRINT 'Da them cot CardPhone.transaction_code'
END
ELSE BEGIN PRINT 'Da co cot CardPhone.transaction_code' END
GO

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='TopReset' AND COLUMN_NAME='reset_over' )
BEGIN 
	Alter TABLE TopReset ADD reset_over int NOT NULL DEFAULT 0
	PRINT 'Da them cot TopReset.reset_over'
END
ELSE BEGIN PRINT 'Da co cot TopReset.reset_over' END

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='TopReset' AND COLUMN_NAME='reset_day' )
BEGIN 
	Alter TABLE TopReset ADD reset_day int NOT NULL DEFAULT 0
	PRINT 'Da them cot TopReset.reset_day'
END
ELSE BEGIN PRINT 'Da co cot TopReset.reset_day' END

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='Dupe_Scan' AND COLUMN_NAME='slgitem' )
BEGIN 
	Alter TABLE Dupe_Scan ADD slgitem tinyint NOT NULL DEFAULT 0
	PRINT 'Da them cot Dupe_Scan.slgitem'
END
ELSE BEGIN PRINT 'Da co cot Dupe_Scan.slgitem' END

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='Character' AND COLUMN_NAME='vweb_gpoint' )
BEGIN 
	Alter TABLE Character ADD vweb_gpoint int NOT NULL DEFAULT 0
	PRINT 'Da them cot Character.vweb_gpoint'
END
ELSE BEGIN PRINT 'Da co cot Character.vweb_gpoint' END

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='Guild' AND COLUMN_NAME='G_TopScore' )
BEGIN 
	Alter TABLE Guild ADD G_TopScore int NOT NULL DEFAULT (0)
	PRINT 'Da them cot Guild.G_TopScore'
END
ELSE BEGIN PRINT 'Da co cot Guild.G_TopScore' END

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='Character' AND COLUMN_NAME='vweb_pointtotal' )
BEGIN 
	Alter TABLE Character ADD vweb_pointtotal int NOT NULL DEFAULT 0
	PRINT 'Da them cot Character.vweb_pointtotal'
END
ELSE BEGIN PRINT 'Da co cot Character.vweb_pointtotal' END

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='Guild' AND COLUMN_NAME='G_TieuPhi' )
BEGIN 
	Alter TABLE Guild ADD G_TieuPhi int NOT NULL DEFAULT (0)
	PRINT 'Da them cot Guild.G_TieuPhi'
END
ELSE BEGIN PRINT 'Da co cot Guild.G_TieuPhi' END

IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='Guild' AND COLUMN_NAME='G_TopTieuPhi' )
BEGIN 
	Alter TABLE Guild ADD G_TopTieuPhi int NOT NULL DEFAULT (0)
	PRINT 'Da them cot Guild.G_TopTieuPhi'
END
ELSE BEGIN PRINT 'Da co cot Guild.G_TopTieuPhi' END