if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_ChaokersCN_SysMembership_Role_R_Privilege_ChaokersCN_SysMembership_Privileges]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ChaokersCN_SysMembership_Role_R_Privilege] DROP CONSTRAINT FK_ChaokersCN_SysMembership_Role_R_Privilege_ChaokersCN_SysMembership_Privileges
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_T_ROLE_P_REFERENCE_T_ROLES]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ChaokersCN_SysMembership_Role_R_Privilege] DROP CONSTRAINT FK_T_ROLE_P_REFERENCE_T_ROLES
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_T_ADMINI_REFERENCE_T_ROLES]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ChaokersCN_SysMembership_User_R_Role] DROP CONSTRAINT FK_T_ADMINI_REFERENCE_T_ROLES
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_T_ADMINI_REFERENCE_T_ADMINI]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ChaokersCN_SysMembership_User_R_Role] DROP CONSTRAINT FK_T_ADMINI_REFERENCE_T_ADMINI
GO

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

CREATE TABLE [dbo].[ChaokersCN_SysMembership_CommonPages] (
	[RecordID] [int] IDENTITY (1, 1) NOT NULL ,
	[PageURL] [varchar] (300) COLLATE Chinese_PRC_CI_AS NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ChaokersCN_SysMembership_Modules] (
	[ModuleID] [int] NOT NULL ,
	[ModuleName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SortIndex] [int] NULL ,
	[Icon] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ChaokersCN_SysMembership_Privileges] (
	[PrivilegeID] [int] NOT NULL ,
	[ModuleID] [int] NULL ,
	[ParentID] [int] NULL ,
	[PrivilegePath] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[PrivilegeDepth] [int] NULL ,
	[IsLeaf] [int] NULL ,
	[PrivilegeName] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[PrivilegeDesc] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[PageURL] [varchar] (300) COLLATE Chinese_PRC_CI_AS NULL ,
	[BtnID] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[PrivilegeType] [tinyint] NULL ,
	[SortIndex] [int] NULL ,
	[DefaultPageURL] [varchar] (300) COLLATE Chinese_PRC_CI_AS NULL ,
	[StateFlag] [int] NULL ,
	[Target] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Icon] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[GroupNum] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[IsDevPriv] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ChaokersCN_SysMembership_Role_R_Privilege] (
	[RoleID] [int] NOT NULL ,
	[PrivilegeID] [int] NOT NULL ,
	[ModuleID] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ChaokersCN_SysMembership_Roles] (
	[RoleID] [int] NOT NULL ,
	[RoleName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[RoleDesc] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[SortIndex] [int] NULL ,
	[StateFlag] [int] NULL ,
	[HasGlobalDataPrivs] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ChaokersCN_SysMembership_User_R_Role] (
	[UserID] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[RoleID] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ChaokersCN_SysMembership_Users] (
	[UserID] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Password] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Nickname] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Email] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[CreateTime] [datetime] NULL ,
	[Remark] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[LastLoginTime] [datetime] NULL ,
	[LastLoginIP] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[LoginCount] [int] NULL ,
	[State] [tinyint] NULL ,
	[EmployeeNo] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ShopPriv] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Announcement_View_Log] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Announcement_ID] [int] NULL ,
	[View_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Announcements] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Content] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[Create_Date] [datetime] NULL ,
	[Create_Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Create_Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Release_Date] [datetime] NULL ,
	[Release_Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Release_Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Release_Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Release_Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Hits] [int] NULL ,
	[Is_Highlight] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_SetTop] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Last_Edit_Log] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Row_State] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_BizTransaction_SequenceNo] (
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Biz_Type] [varchar] (2) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[SequenceNo] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Cancelled_Cards] (
	[CardNo] [varchar] (30) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Operate_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_ChargeBook_Item] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MasterID] [int] NULL ,
	[Item_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Unit] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Price] [numeric](9, 2) NULL ,
	[Quantity] [numeric](9, 2) NULL ,
	[Charges] [numeric](9, 2) NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Waiter_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Waiter_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_ChargeBook_Master] (
	[Book_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[BizID] [int] NULL ,
	[Charge_Biz_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[CardNo] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Sex] [varchar] (2) COLLATE Chinese_PRC_CI_AS NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operate_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[PayType_Desc] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Charges] [numeric](9, 2) NULL ,
	[Donate_Points] [int] NULL ,
	[Customer_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Gift_Desc] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[Member_PointCardID] [int] NULL ,
	[PointCard_ConsumeQuantity] [int] NULL ,
	[PointCard_ID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[PointCard_Name] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Settle_Account_Flag] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Bill_Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Bill_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[BCX_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[CX_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Settle_Account_ID] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_ChargeItem_BillSequenceNo] (
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Bill_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[SequenceNo] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_ChargeItem_Category_Dict] (
	[Category_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Category_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_SysDefine] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_ChargeItem_Dict] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Item_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Input_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Unit] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Price] [numeric](9, 2) NULL ,
	[Purchase_Price] [numeric](9, 2) NULL ,
	[Create_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Category_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Commision_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Commision_XS] [numeric](9, 2) NULL ,
	[Is_Support_SaleStrategy] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_SysDefine] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_StockManage] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Min_Level_Number] [numeric](9, 2) NULL ,
	[Max_Level_Number] [numeric](9, 2) NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Member_Discount] [numeric](4, 2) NULL ,
	[Member_Price] [numeric](4, 2) NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Desc] [varchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[Stars] [tinyint] NULL ,
	[Order_Count] [int] NULL ,
	[Comment_Count] [int] NULL ,
	[Haoping_Count] [int] NULL ,
	[Chaping_Count] [int] NULL ,
	[Share_Count] [int] NULL ,
	[Is_Support_Comment] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_ChargeItem_Discount] (
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Level_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Member_Discount] [numeric](4, 2) NULL ,
	[Member_Price] [numeric](9, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_ChargeItem_Donate_Items] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MasterID] [int] NULL ,
	[Item_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Category] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Unit] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Price] [numeric](9, 2) NULL ,
	[Quantity] [numeric](9, 2) NULL ,
	[Amount] [numeric](9, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_ChargeItem_Donate_Master] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Donate_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Donate_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[CardNo] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Customer_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Bill_Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Bill_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[BCX_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[CX_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Stock_Bill_No] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operate_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_ChargeItem_Histories] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operate_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (300) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_ChargeItem_In_Class_Dict] (
	[Class_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Class_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_SysDefine] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_Show] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Input_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_ChargeItem_In_Items] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MasterID] [int] NULL ,
	[Item_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Category] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Input_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Unit] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Price] [numeric](9, 2) NULL ,
	[Quantity] [numeric](9, 2) NULL ,
	[Amount] [numeric](9, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_ChargeItem_In_Master] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Bill_No] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Out_Bill_No] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Invoice_No] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Storage_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Storage_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[In_Class_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[In_Class_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Supplier_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Supplier_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Supplier_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Register_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Register_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Register_Date] [datetime] NULL ,
	[Checker_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Checker_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Check_Date] [datetime] NULL ,
	[Bill_Amount] [numeric](9, 2) NULL ,
	[Print_Count] [int] NULL ,
	[Last_Print_Date] [datetime] NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_ChargeItem_Out_Class_Dict] (
	[Class_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Class_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_SysDefine] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_Show] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Input_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_ChargeItem_Out_Items] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MasterID] [int] NULL ,
	[Item_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Category] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Input_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Unit] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Price] [numeric](9, 2) NULL ,
	[Quantity] [numeric](9, 2) NULL ,
	[Amount] [numeric](9, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_ChargeItem_Out_Master] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Bill_No] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[In_Bill_No] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Storage_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Storage_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Out_Class_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Out_Class_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Receiver_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Receiver_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Receiver_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Register_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Register_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Register_Date] [datetime] NULL ,
	[Checker_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Checker_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Check_Date] [datetime] NULL ,
	[Bill_Amount] [numeric](9, 2) NULL ,
	[Print_Count] [int] NULL ,
	[Last_Print_Date] [datetime] NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_ChargeItem_Stock] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Stock_Count] [numeric](9, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_ChargeItem_StockInited_Shops] (
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_ChargeItem_Stock_Book] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Stock_ID] [int] NULL ,
	[Storage_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Storage_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Unit] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Price] [numeric](9, 2) NULL ,
	[This_Quantity] [numeric](9, 2) NULL ,
	[Pre_Quantity] [numeric](9, 2) NULL ,
	[After_Quantity] [numeric](9, 2) NULL ,
	[Amount] [numeric](9, 2) NULL ,
	[Direction] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Class_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Class_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Biz_No] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operate_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_ChargeItem_Supplier_Dict] (
	[Supplier_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Supplier_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Input_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Charge_DayAccount_Items] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MasterID] [int] NULL ,
	[PayType_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[PayType_Name] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Yj_Amount] [numeric](18, 2) NULL ,
	[Biz_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Charge_DayAccount_Master] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[SettleAccount_Date] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Charge_Amount] [numeric](18, 2) NULL ,
	[Refund_Amount] [numeric](18, 2) NULL ,
	[Discount_Amount] [numeric](18, 2) NULL ,
	[Donate_Amount] [numeric](18, 2) NULL ,
	[Cost_Points] [int] NULL ,
	[Czsk_Amount] [numeric](18, 2) NULL ,
	[Cztk_Amount] [numeric](18, 2) NULL ,
	[Xfsk_Amount] [numeric](18, 2) NULL ,
	[Xftk_Amount] [numeric](18, 2) NULL ,
	[Jckxssk_Amount] [numeric](18, 2) NULL ,
	[Jckxstk_Amount] [numeric](18, 2) NULL ,
	[Tx_Amount] [numeric](18, 2) NULL ,
	[Czsk_Count] [int] NULL ,
	[Cztk_Count] [int] NULL ,
	[Xfsk_Count] [int] NULL ,
	[Xftk_Count] [int] NULL ,
	[Jckxssk_Count] [int] NULL ,
	[Jckxstk_Count] [int] NULL ,
	[Tx_Count] [int] NULL ,
	[Yj_Cash] [numeric](18, 2) NULL ,
	[Yj_MasterCard] [numeric](18, 2) NULL ,
	[Yj_DebitCard] [numeric](18, 2) NULL ,
	[Yj_Weixin] [numeric](18, 2) NULL ,
	[Yj_Zhifubao] [numeric](18, 2) NULL ,
	[Yj_Huiyuanka] [numeric](18, 2) NULL ,
	[Yj_PointCard] [numeric](18, 2) NULL ,
	[Yj_Voucher] [numeric](18, 2) NULL ,
	[Yj_Point] [numeric](18, 2) NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[SettleAccount_DateTime] [datetime] NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Charge_FavItems] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Sort_Index] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Charge_Group_Items] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MasterID] [int] NULL ,
	[Item_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Unit] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Price] [numeric](9, 2) NULL ,
	[Quantity] [numeric](9, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Charge_Group_Master] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Group_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Input_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Costs] [numeric](9, 2) NULL ,
	[Create_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Sort_Index] [int] NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Charge_Items] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MasterID] [int] NULL ,
	[Item_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Category] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Unit] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Price] [numeric](9, 2) NULL ,
	[Quantity] [numeric](9, 2) NULL ,
	[Costs] [numeric](9, 2) NULL ,
	[Charges] [numeric](9, 2) NULL ,
	[Discounts] [numeric](9, 2) NULL ,
	[Discount_Desc] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Waiter_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Waiter_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Settle_Account_Flag] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Charge_Master] (
	[Charge_ID] [int] IDENTITY (1, 1) NOT NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Charge_Biz_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[CardNo] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Sex] [varchar] (2) COLLATE Chinese_PRC_CI_AS NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operate_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Costs] [numeric](9, 2) NULL ,
	[Charges] [numeric](9, 2) NULL ,
	[Discounts] [numeric](9, 2) NULL ,
	[PayAmount] [numeric](9, 2) NULL ,
	[Cost_Points] [int] NULL ,
	[Donate_Points] [int] NULL ,
	[SK_Amount] [numeric](9, 2) NULL ,
	[ZL_Amount] [numeric](9, 2) NULL ,
	[PayType_Desc] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Customer_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Gift_Desc] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[Member_PointCardID] [int] NULL ,
	[PointCard_ConsumeQuantity] [int] NULL ,
	[PointCard_ID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[PointCard_Name] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Bill_Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Bill_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[BCX_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[CX_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Settle_Account_Flag] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Settle_Account_ID] [int] NULL ,
	[DataFrom] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Charge_Payments] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MasterID] [int] NULL ,
	[PayType_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[PayType_Name] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[PayAmount] [numeric](9, 2) NULL ,
	[Certificate_No] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Charge_VS_Stock] (
	[Charge_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[ChargeItem_Out_Bill_No] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Customer_Debts] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Customer_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Consume_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Consume_Date] [datetime] NULL ,
	[Consume_Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Consume_Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Consume_Amount] [numeric](9, 2) NULL ,
	[Is_Repaied] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Repay_Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Repay_Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Repay_Date] [datetime] NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Department_Dict] (
	[Dept_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Dept_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Employee_CanLogin_Shops] (
	[Employee_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Employees] (
	[Employee_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Employee_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Sex] [varchar] (2) COLLATE Chinese_PRC_CI_AS NULL ,
	[BirthDate] [datetime] NULL ,
	[IDCardNo] [varchar] (18) COLLATE Chinese_PRC_CI_AS NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Contact_Address] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Dept_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Create_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_SysDefine] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_Show] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Input_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Gift_BillSequenceNo] (
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Bill_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[SequenceNo] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Gift_Category_Dict] (
	[Category_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Category_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Gift_Dict] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Item_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Input_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Unit] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Purchase_Price] [numeric](9, 2) NULL ,
	[Create_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Category_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Cost_Points] [int] NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Gift_Donate_Items] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MasterID] [int] NULL ,
	[Item_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Unit] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Price] [numeric](9, 2) NULL ,
	[Quantity] [numeric](9, 2) NULL ,
	[Amount] [numeric](9, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Gift_Donate_Master] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Donate_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Donate_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[CardNo] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Customer_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Bill_Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Bill_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[BCX_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[CX_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Stock_Bill_No] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operate_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Gift_Exchange_Items] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MasterID] [int] NULL ,
	[Item_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Unit] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Price] [numeric](9, 2) NULL ,
	[Quantity] [numeric](9, 2) NULL ,
	[Amount] [numeric](9, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Gift_Exchange_Master] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[CardNo] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Cost_Points] [int] NULL ,
	[Bill_Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Bill_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[BCX_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[CX_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Stock_Bill_No] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operate_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Settle_Account_Flag] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Gift_In_Class_Dict] (
	[Class_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Class_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_SysDefine] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_Show] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Input_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Gift_In_Items] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MasterID] [int] NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Input_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Unit] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Price] [numeric](9, 2) NULL ,
	[Quantity] [numeric](9, 2) NULL ,
	[Amount] [numeric](9, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Gift_In_Master] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Bill_No] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Out_Bill_No] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Invoice_No] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Storage_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Storage_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[In_Class_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[In_Class_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Supplier_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Supplier_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Supplier_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Register_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Register_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Register_Date] [datetime] NULL ,
	[Checker_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Checker_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Check_Date] [datetime] NULL ,
	[Bill_Amount] [numeric](9, 2) NULL ,
	[Print_Count] [int] NULL ,
	[Last_Print_Date] [datetime] NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Gift_Out_Class_Dict] (
	[Class_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Class_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_SysDefine] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_Show] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Input_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Gift_Out_Items] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MasterID] [int] NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Input_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Unit] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Price] [numeric](9, 2) NULL ,
	[Quantity] [numeric](9, 2) NULL ,
	[Amount] [numeric](9, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Gift_Out_Master] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Bill_No] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[In_Bill_No] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Storage_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Storage_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Out_Class_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Out_Class_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Receiver_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Receiver_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Receiver_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Register_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Register_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Register_Date] [datetime] NULL ,
	[Checker_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Checker_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Check_Date] [datetime] NULL ,
	[Bill_Amount] [numeric](9, 2) NULL ,
	[Print_Count] [int] NULL ,
	[Last_Print_Date] [datetime] NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Gift_Stock] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Stock_Count] [numeric](9, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Gift_StockInited_Shops] (
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Gift_Stock_Book] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Stock_ID] [int] NULL ,
	[Storage_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Storage_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Unit] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Price] [numeric](9, 2) NULL ,
	[This_Quantity] [numeric](9, 2) NULL ,
	[Pre_Quantity] [numeric](9, 2) NULL ,
	[After_Quantity] [numeric](9, 2) NULL ,
	[Amount] [numeric](9, 2) NULL ,
	[Direction] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Class_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Class_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Biz_No] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operate_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Gift_Supplier_Dict] (
	[Supplier_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Supplier_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Input_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Interface_MC_Items] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[BizNo] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Category] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Unit] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Price] [numeric](9, 2) NULL ,
	[Quantity] [numeric](9, 2) NULL ,
	[Costs] [numeric](9, 2) NULL ,
	[Charges] [numeric](9, 2) NULL ,
	[Discounts] [numeric](9, 2) NULL ,
	[Discount_Desc] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Waiter_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Waiter_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Settle_Account_Flag] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Interface_MC_Master] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[BizNo] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[CardNo] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Sex] [varchar] (2) COLLATE Chinese_PRC_CI_AS NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operate_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Costs] [numeric](9, 2) NULL ,
	[Charges] [numeric](9, 2) NULL ,
	[Discounts] [numeric](9, 2) NULL ,
	[PayAmount] [numeric](9, 2) NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Interface_MC_Payments] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[BizNo] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[PayType_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[PayType_Name] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[PayAmount] [numeric](9, 2) NULL ,
	[Certificate_No] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Member_Account_Book] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[This_Amount] [numeric](9, 2) NULL ,
	[Pre_Amount] [numeric](9, 2) NULL ,
	[After_Amount] [numeric](9, 2) NULL ,
	[Operate_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Member_BasicInfo] (
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Member_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Sex] [varchar] (2) COLLATE Chinese_PRC_CI_AS NULL ,
	[BirthDate] [datetime] NULL ,
	[IDCardNo] [varchar] (18) COLLATE Chinese_PRC_CI_AS NULL ,
	[Photo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[WeixinNo] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Email] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Contact_Address] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Postal_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Level_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[CardNo] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Password] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Account_Balance] [numeric](9, 2) NULL ,
	[Account_Points] [int] NULL ,
	[Introducer_ID] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Introducer_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Create_Date] [datetime] NULL ,
	[Operate_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Salesman_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Salesman_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Last_Charge_Date] [datetime] NULL ,
	[Last_Consume_Date] [datetime] NULL ,
	[Last_Cosume_ShopID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[AccountBalance_Verification_Code] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[AccountPoints_Verification_Code] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Total_Charge_Amount] [numeric](18, 2) NULL ,
	[Total_Withdraw_Amount] [numeric](18, 2) NULL ,
	[Total_Consume_Amount] [numeric](18, 2) NULL ,
	[Total_PointCardCharge_Amount] [numeric](18, 2) NULL ,
	[Total_PointCardConsume_Amount] [numeric](18, 2) NULL ,
	[Total_BeDonated_Amount] [numeric](18, 2) NULL ,
	[Total_DonatedConsume_Amount] [numeric](18, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Member_ChargeItems] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Item_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Unit] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Quantity] [numeric](9, 2) NULL ,
	[Consumed_Quantity] [numeric](9, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Member_ID_Creator] (
	[MemberID] [int] IDENTITY (1, 1) NOT NULL ,
	[Insert_Date] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Member_KeyInfo_Histories] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Old_Value] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[New_Value] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operate_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Info_Type] [varchar] (2) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (300) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Member_Level_Dict] (
	[Level_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Level_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Level_Value] [tinyint] NULL ,
	[Is_Default] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Member_Level_Histories] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Old_Level] [tinyint] NULL ,
	[New_Level] [tinyint] NULL ,
	[Operate_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (300) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Member_Login_Logs] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Member_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Login_DateTime] [datetime] NULL ,
	[Login_System] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Login_IP] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Member_PointCardCharges] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[CardNo] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Sex] [varchar] (2) COLLATE Chinese_PRC_CI_AS NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Charge_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[PayType_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[PayType_Name] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Pay_Amount] [numeric](9, 2) NULL ,
	[PointCard_ID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[PointCard_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[PointCard_Name] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[PointCard_Price] [numeric](9, 2) NULL ,
	[PointCard_SrvCount] [int] NULL ,
	[PointCard_Begin_Date] [datetime] NULL ,
	[PointCard_End_Date] [datetime] NULL ,
	[PointCard_Term] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Bill_Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Bill_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[BCX_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[CX_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Settle_Account_Flag] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Settle_Account_ID] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Member_PointCards] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[PointCardCharge_ID] [int] NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[PointCard_ID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[PointCard_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[PointCard_Name] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[PointCard_Price] [numeric](9, 2) NULL ,
	[PointCard_SrvCount] [int] NULL ,
	[PointCard_Begin_Date] [datetime] NULL ,
	[PointCard_End_Date] [datetime] NULL ,
	[PointCard_Term] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[PointCard_RemainingCount] [int] NULL ,
	[Got_Date] [datetime] NULL ,
	[Member_Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Member_Point_Book] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[This_Quantity] [int] NULL ,
	[Pre_Quantity] [int] NULL ,
	[After_Quantity] [int] NULL ,
	[Operate_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Member_Relationship] (
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[ParentID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Life_Line] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[Life_Level] [int] NULL ,
	[HasChildren] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Member_WalletCharges] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[CardNo] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Sex] [varchar] (2) COLLATE Chinese_PRC_CI_AS NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Charge_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[PayType_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[PayType_Name] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Pay_Amount] [numeric](9, 2) NULL ,
	[Charge_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Donate_Amount] [numeric](9, 2) NULL ,
	[Charge_Amount] [numeric](9, 2) NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Bill_Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Bill_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[BCX_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[CX_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Settle_Account_Flag] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Settle_Account_ID] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Member_WalletWithdraw] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[CardNo] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Sex] [varchar] (2) COLLATE Chinese_PRC_CI_AS NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Withdraw_Date] [datetime] NULL ,
	[Withdraw_Amount] [numeric](9, 2) NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[PayType_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[PayType_Name] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Settle_Account_Flag] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Settle_Account_ID] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_New_Vouchers] (
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Face_Value] [numeric](9, 2) NULL ,
	[Create_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Expire_Date] [datetime] NULL ,
	[Row_Flag] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Operator_Act_Logs] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Login_ID] [int] NULL ,
	[SystemName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Act_Summary] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Act_Detail] [varchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[Act_DateTime] [datetime] NULL ,
	[Act_IP] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Act_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Operator_Login_Logs] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Operator_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Login_DateTime] [datetime] NULL ,
	[Login_IP] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Login_System] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Login_Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Login_Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_PayType_Dict] (
	[PayType_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[PayType_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Place_Area] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[areaID] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[area] [nvarchar] (60) COLLATE Chinese_PRC_CI_AS NULL ,
	[father] [nvarchar] (6) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Place_City] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[cityID] [nvarchar] (6) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[city] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[father] [nvarchar] (6) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Place_Province] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[provinceID] [nvarchar] (6) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[province] [nvarchar] (40) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_PointCard_ChargeItems] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[PointCard_ID] [int] NULL ,
	[Item_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Unit] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Price] [numeric](9, 2) NULL ,
	[Discounted_Price] [numeric](9, 2) NULL ,
	[Quantity] [numeric](9, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_PointCards] (
	[PointCard_ID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[PointCard_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[PointCard_Name] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[PointCard_Price] [numeric](9, 2) NULL ,
	[PointCard_SrvCount] [int] NULL ,
	[PointCard_ValidTerm_Number] [int] NULL ,
	[PointCard_ValidTerm_Unit] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[PointCard_Enable_Rule] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Create_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Point_Donate] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[CardNo] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Donate_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Donate_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Donate_Points] [int] NULL ,
	[Bill_Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Bill_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[BCX_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[CX_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operate_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SMS_Notification_Templates] (
	[Template_Key] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Template_Value] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[Template_Desc] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SMS_Received] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[SMS_Content] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[Received_Date] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SMS_Resended_Fail] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[SourceID] [int] NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[SMS_Content] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[Planning_Send_Date] [datetime] NULL ,
	[Resend_Times] [int] NULL ,
	[Send_Date] [datetime] NULL ,
	[Last_Send_Date] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SMS_SendOut] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[SourceID] [int] NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[SMS_Content] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[Planning_Send_Date] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SMS_SendReason_Dict] (
	[Reason_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Reason_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SMS_Send_Items] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MasterID] [int] NULL ,
	[CardNo] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_Suc] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SMS_Send_Master] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Send_Reason] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Send_Count] [int] NULL ,
	[Planning_Send_Date] [datetime] NULL ,
	[SMS_Content] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operate_Date] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SMS_Send_Temp] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Create_Date] [datetime] NULL ,
	[Session_ID] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SMS_Sended_Fail] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[SourceID] [int] NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[SMS_Content] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[Planning_Send_Date] [datetime] NULL ,
	[Resend_Times] [int] NULL ,
	[Send_Date] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SMS_Sended_Suc] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[SourceID] [int] NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[SMS_Content] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[Planning_Send_Date] [datetime] NULL ,
	[Send_Date] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SMS_TelBookContactCategory_Dict] (
	[Category_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Category_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_SysDefine] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SMS_TelBookContacts] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Contact_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Input_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Category_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SMS_TemplateCategory_Dict] (
	[Category_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Category_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_SysDefine] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SMS_Templates] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Title] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Category_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Content] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[Create_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SS_Discount_Amount_Rules] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Strategy_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Charges] [numeric](9, 2) NULL ,
	[Discount_Amount] [numeric](9, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SS_Discount_ChargeItems] (
	[Strategy_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SS_Discount_Rate_Rules] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Strategy_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Charges] [numeric](9, 2) NULL ,
	[Discount_Rate] [numeric](9, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SS_Donate_Amount_Rules] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Strategy_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Charges] [numeric](9, 2) NULL ,
	[Donate_Amount] [numeric](9, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SS_Donate_Gift_Rules] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Strategy_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Charges] [numeric](9, 2) NULL ,
	[Item_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Item_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Unit] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Quantity] [numeric](9, 2) NULL ,
	[Price] [numeric](9, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SS_Donate_Point_Rules] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Strategy_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Charges] [numeric](9, 2) NULL ,
	[Donate_Points] [int] NULL ,
	[Rule_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Rule_Expression] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SS_Donate_Voucher_Rules] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Strategy_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Charges] [numeric](9, 2) NULL ,
	[Donate_Amount] [numeric](9, 2) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_SaleStrategy_Category_Dict] (
	[Category_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Category_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Sale_Strategies] (
	[Strategy_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Strategy_Name] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Strategy_Desc] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Biz_Type] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Category_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Limit_Age_Range] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Limit_Sex] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Limit_Customer_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Limit_Member_Level] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Discount_Range_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Begin_Date] [datetime] NULL ,
	[End_Date] [datetime] NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_Donate_Amount] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_Donate_Gift] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_Donate_Point] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_Donate_Voucher] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_Discount_Amount] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Is_Discount_Rate] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Create_Date] [datetime] NULL ,
	[Create_Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Create_Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Shop_Dict] (
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Phone] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Address] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Shop_Vouchers] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Voucher_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Got_Quantity] [int] NULL ,
	[Distributed_Quantity] [int] NULL ,
	[Used_Quantity] [int] NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_System_Params] (
	[ConfigKey] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[ConfigValue] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[ConfigDesc] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Unit_Dict] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Unit_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Input_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Voucher_Dict] (
	[Voucher_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Voucher_Name] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Face_Value] [numeric](9, 2) NULL ,
	[Limit_MaxUseTimes_PerDay] [int] NULL ,
	[Limit_MinConsumeAmount_PerBill] [numeric](9, 2) NULL ,
	[Create_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Released_Quantity] [int] NULL ,
	[Distributed_Quantity] [int] NULL ,
	[Used_Quantity] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Voucher_Donate] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Donate_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Donate_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Voucher_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Voucher_Name] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Face_Value] [numeric](9, 2) NULL ,
	[VoucherNo] [varchar] (30) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[CardNo] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[MobileNo] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Customer_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Bill_Status] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Bill_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[BCX_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[CX_BizNo] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operate_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Remark] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Voucher_Instances] (
	[VoucherNo] [varchar] (30) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Voucher_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[MasterID] [int] NULL ,
	[Voucher_TakeEffect_Date] [datetime] NULL ,
	[Voucher_Expire_Date] [datetime] NULL ,
	[BelongTo_Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[BelongTo_Shop_Name] [char] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Allocate_Date] [datetime] NULL ,
	[Allocate_Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Allocate_Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Distribute_Date] [datetime] NULL ,
	[Distribute_Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Distribute_Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Customer_Type] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[MemberID] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Using_Flag] [varchar] (1) COLLATE Chinese_PRC_CI_AS NULL ,
	[Used_Date] [datetime] NULL ,
	[Used_Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Used_Shop_Name] [char] (10) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[va_Voucher_ReleaseLogs] (
	[RID] [int] IDENTITY (1, 1) NOT NULL ,
	[Voucher_Code] [varchar] (30) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Release_Quantity] [int] NULL ,
	[Voucher_TakeEffect_Date] [datetime] NULL ,
	[Voucher_Expire_Date] [datetime] NULL ,
	[Operator_Code] [varchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Name] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Shop_Code] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Operator_Shop_Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Release_Date] [datetime] NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[ChaokersCN_SysMembership_CommonPages] WITH NOCHECK ADD 
	CONSTRAINT [PK_ChaokersCN_SysMembership_CommonPages] PRIMARY KEY  CLUSTERED 
	(
		[PageURL]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ChaokersCN_SysMembership_Modules] WITH NOCHECK ADD 
	CONSTRAINT [PK_ChaokersCN_SysMembership_Modules] PRIMARY KEY  CLUSTERED 
	(
		[ModuleID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ChaokersCN_SysMembership_Privileges] WITH NOCHECK ADD 
	CONSTRAINT [PK_ChaokersCN_SysMembership_Privileges] PRIMARY KEY  CLUSTERED 
	(
		[PrivilegeID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ChaokersCN_SysMembership_Role_R_Privilege] WITH NOCHECK ADD 
	CONSTRAINT [PK_T_ROLE_POWER] PRIMARY KEY  CLUSTERED 
	(
		[RoleID],
		[PrivilegeID],
		[ModuleID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ChaokersCN_SysMembership_Roles] WITH NOCHECK ADD 
	CONSTRAINT [PK_T_ROLES] PRIMARY KEY  CLUSTERED 
	(
		[RoleID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ChaokersCN_SysMembership_User_R_Role] WITH NOCHECK ADD 
	CONSTRAINT [PK_T_ADMINISTRATOR_ROLE] PRIMARY KEY  CLUSTERED 
	(
		[UserID],
		[RoleID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ChaokersCN_SysMembership_Users] WITH NOCHECK ADD 
	CONSTRAINT [PK_T_ADMINISTRATORS] PRIMARY KEY  CLUSTERED 
	(
		[UserID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Announcement_View_Log] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_ANNOUNCEMENT_VIEW_LOG] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Announcements] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_ANNOUNCEMENTS] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_BizTransaction_SequenceNo] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_BIZTRANSACTION_SEQUENCEN] PRIMARY KEY  CLUSTERED 
	(
		[Biz_Type],
		[Shop_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Cancelled_Cards] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CANCELLED_CARDS] PRIMARY KEY  CLUSTERED 
	(
		[CardNo]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_ChargeBook_Item] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGEBOOK_ITEM] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_ChargeBook_Master] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGEBOOK_MASTER] PRIMARY KEY  CLUSTERED 
	(
		[Book_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_ChargeItem_BillSequenceNo] WITH NOCHECK ADD 
	CONSTRAINT [PK_va_ChargeItem_BillSequenceNo] PRIMARY KEY  CLUSTERED 
	(
		[Shop_Code],
		[Bill_Type]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_ChargeItem_Category_Dict] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGEITEM_CATEGORY_DICT] PRIMARY KEY  CLUSTERED 
	(
		[Category_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_ChargeItem_Dict] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGEITEM_DICT] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_ChargeItem_Discount] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGEITEM_DISCOUNT] PRIMARY KEY  CLUSTERED 
	(
		[Shop_Code],
		[Item_Code],
		[Level_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_ChargeItem_Donate_Items] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGEITEM_DONATE_ITEMS] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_ChargeItem_Donate_Master] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGEITEM_DONATE_MASTER] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_ChargeItem_Histories] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGEITEM_HISTORIES] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_ChargeItem_In_Class_Dict] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGEITEM_IN_CLASS_DICT] PRIMARY KEY  CLUSTERED 
	(
		[Class_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_ChargeItem_In_Master] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGEITEM_IN_MASTER] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_ChargeItem_Out_Class_Dict] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGEITEM_OUT_CLASS_DIC] PRIMARY KEY  CLUSTERED 
	(
		[Class_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_ChargeItem_Out_Master] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGEITEM_OUT_MASTER] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_ChargeItem_Stock] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGEITEM_STOCK] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_ChargeItem_StockInited_Shops] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGEITEM_STOCKINITED_S] PRIMARY KEY  CLUSTERED 
	(
		[Shop_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_ChargeItem_Supplier_Dict] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGEITEM_SUPPLIER_DICT] PRIMARY KEY  CLUSTERED 
	(
		[Supplier_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Charge_DayAccount_Items] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGE_DAYACCOUNT_ITEMS] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Charge_DayAccount_Master] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGE_DAYACCOUNT_MASTER] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Charge_FavItems] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGE_FAVITEMS] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Charge_Group_Items] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGE_GROUP_ITEMS] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Charge_Group_Master] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGE_GROUPS_MASTER] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Charge_Items] WITH NOCHECK ADD 
	CONSTRAINT [PK_A_CHARGE_ITEM] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Charge_Master] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGE_MASTER] PRIMARY KEY  CLUSTERED 
	(
		[Charge_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Charge_Payments] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGE_PAYMENTS] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Charge_VS_Stock] WITH NOCHECK ADD 
	CONSTRAINT [PK_va_Charge_VS_Stock] PRIMARY KEY  CLUSTERED 
	(
		[Charge_BizNo],
		[ChargeItem_Out_Bill_No]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Department_Dict] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_DEPARTMENT_DICT] PRIMARY KEY  CLUSTERED 
	(
		[Dept_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Employee_CanLogin_Shops] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_EMPLOYEE_CANLOGIN_SHOPS] PRIMARY KEY  CLUSTERED 
	(
		[Employee_Code],
		[Shop_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Employees] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_EMPLOYEES] PRIMARY KEY  CLUSTERED 
	(
		[Employee_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Gift_BillSequenceNo] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_GIFT_BILLSEQUENCENO] PRIMARY KEY  CLUSTERED 
	(
		[Bill_Type],
		[Shop_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Gift_Category_Dict] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_GIFT_CATEGORY_DICT] PRIMARY KEY  CLUSTERED 
	(
		[Category_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Gift_Dict] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_GIFT_DICT] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Gift_Donate_Items] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_GIFT_DONATE_ITEMS] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Gift_Donate_Master] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_GIFT_DONATE_MASTER] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Gift_Exchange_Items] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_GIFT_EXCHANGE_ITEMS] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Gift_Exchange_Master] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_GIFT_EXCHANGE_MASTER] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Gift_In_Class_Dict] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_GIFT_IN_CLASS_DICT] PRIMARY KEY  CLUSTERED 
	(
		[Class_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Gift_In_Master] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_GIFT_IN_MASTER] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Gift_Out_Class_Dict] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_GIFT_OUT_CLASS_DICT] PRIMARY KEY  CLUSTERED 
	(
		[Class_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Gift_Out_Master] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_GIFT_OUT_MASTER] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Gift_Stock] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_GIFT_STOCK] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Gift_StockInited_Shops] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_GIFT_STOCKINITED_SHOPS] PRIMARY KEY  CLUSTERED 
	(
		[Shop_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Gift_Supplier_Dict] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_GIFT_SUPPLIER_DICT] PRIMARY KEY  CLUSTERED 
	(
		[Supplier_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Interface_MC_Items] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_INTERFACE_MC_ITEMS] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Interface_MC_Master] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_INTERFACE_MC_MASTER] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Interface_MC_Payments] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_INTERFACE_MC_PAYMENTS] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Member_Account_Book] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_MEMBER_ACCOUNT_BOOK] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Member_BasicInfo] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_MEMBER_BASICINFO] PRIMARY KEY  CLUSTERED 
	(
		[MemberID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Member_ChargeItems] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_MEMBER_CHARGEITEMS] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Member_ID_Creator] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_MEMBER_ID_CREATOR] PRIMARY KEY  CLUSTERED 
	(
		[MemberID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Member_KeyInfo_Histories] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_MEMBER_KEYINFO_HISTORIES] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Member_Level_Dict] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_MEMBER_LEVEL_DICT] PRIMARY KEY  CLUSTERED 
	(
		[Level_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Member_Level_Histories] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_MEMBER_LEVEL_HISTORIES] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Member_Login_Logs] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_MEMBER_LOGIN_LOGS] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Member_PointCardCharges] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_MEMBER_POINTCARDCHARGES] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Member_PointCards] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_MEMBER_POINTCARDS] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Member_Point_Book] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_MEMBER_POINT_BOOK] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Member_Relationship] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_MEMBER_RELATIONSHIP] PRIMARY KEY  CLUSTERED 
	(
		[MemberID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_New_Vouchers] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_NEW_VOUCHERS] PRIMARY KEY  CLUSTERED 
	(
		[Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Operator_Act_Logs] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_OPERATOR_ACT_LOGS] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Operator_Login_Logs] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_OPERATOR_LOGIN_LOGS] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_PayType_Dict] WITH NOCHECK ADD 
	CONSTRAINT [PK_va_PayType_Dict] PRIMARY KEY  CLUSTERED 
	(
		[PayType_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Place_Area] WITH NOCHECK ADD 
	CONSTRAINT [PK_ShopEx_Area] PRIMARY KEY  CLUSTERED 
	(
		[areaID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Place_City] WITH NOCHECK ADD 
	CONSTRAINT [PK_ShopEx_City] PRIMARY KEY  CLUSTERED 
	(
		[cityID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Place_Province] WITH NOCHECK ADD 
	CONSTRAINT [PK_va_Place_Province] PRIMARY KEY  CLUSTERED 
	(
		[provinceID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_PointCard_ChargeItems] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_POINTCARD_CHARGEITEMS] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_PointCards] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_POINTCARDS] PRIMARY KEY  CLUSTERED 
	(
		[PointCard_ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Point_Donate] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_POINT_DONATE] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SMS_Notification_Templates] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SMS_NOTIFICATION_TEMPLAT] PRIMARY KEY  CLUSTERED 
	(
		[Template_Key]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SMS_Received] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SMS_RECEIVED] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SMS_Resended_Fail] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SMS_RESENDED_FAIL] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SMS_SendOut] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SMS_SENDOUT] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SMS_SendReason_Dict] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SMS_SENDREASON_DICT] PRIMARY KEY  CLUSTERED 
	(
		[Reason_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SMS_Send_Items] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SMS_SEND_ITEMS] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SMS_Send_Master] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SMS_SEND_MASTER] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SMS_Send_Temp] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SMS_SEND_TEMP] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SMS_Sended_Fail] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SMS_SENDED_FAIL] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SMS_Sended_Suc] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SMS_SENDED_SUC] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SMS_TelBookContactCategory_Dict] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SMS_TELBOOKCONTACTCATEGO] PRIMARY KEY  CLUSTERED 
	(
		[Category_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SMS_TelBookContacts] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SMS_TELBOOKCONTACTS] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SMS_TemplateCategory_Dict] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SMS_TEMPLATECATEGORY_DIC] PRIMARY KEY  CLUSTERED 
	(
		[Category_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SMS_Templates] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SMS_TEMPLATES] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SS_Discount_Amount_Rules] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SS_DISCOUNT_AMOUNT_RULE] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SS_Discount_ChargeItems] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SS_DISCOUNT_CHARGEITEMS] PRIMARY KEY  CLUSTERED 
	(
		[Strategy_Code],
		[Item_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SS_Discount_Rate_Rules] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SS_DISCOUNT_RATE_RULES] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SS_Donate_Amount_Rules] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SS_DONATE_AMOUNT_RULES] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SS_Donate_Gift_Rules] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SS_DONATE_GIFT_RULES] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SS_Donate_Point_Rules] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SS_DONATE_POINT_RULES] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SS_Donate_Voucher_Rules] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SS_DONATE_VOUCHER_RULES] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_SaleStrategy_Category_Dict] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SALESTRATEGY_CATEGORY_DI] PRIMARY KEY  CLUSTERED 
	(
		[Category_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Shop_Dict] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SHOP_DICT] PRIMARY KEY  CLUSTERED 
	(
		[Shop_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Shop_Vouchers] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_SHOP_VOUCHERS] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_System_Params] WITH NOCHECK ADD 
	CONSTRAINT [PK_va_System_Params] PRIMARY KEY  CLUSTERED 
	(
		[ConfigKey]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Unit_Dict] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_CHARGEITEM_UNIT_DICT] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Voucher_Dict] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_VOUCHER_DICT] PRIMARY KEY  CLUSTERED 
	(
		[Voucher_Code]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Voucher_Donate] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_VOUCHER_DONATE] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Voucher_Instances] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_VOUCHER_RELEASE_ITEMS] PRIMARY KEY  CLUSTERED 
	(
		[VoucherNo]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[va_Voucher_ReleaseLogs] WITH NOCHECK ADD 
	CONSTRAINT [PK_VA_VOUCHER_RELEASE_MASTER] PRIMARY KEY  CLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ChaokersCN_SysMembership_Privileges] ADD 
	CONSTRAINT [DF_ChaokersCN_SysMembership_Privileges_IsDevPriv] DEFAULT (0) FOR [IsDevPriv]
GO

ALTER TABLE [dbo].[ChaokersCN_SysMembership_Roles] ADD 
	CONSTRAINT [DF_ChaokersCN_SysMembership_Roles_SortIndex] DEFAULT (0) FOR [SortIndex],
	CONSTRAINT [DF_ChaokersCN_SysMembership_Roles_GlobalDataPrivs] DEFAULT (0) FOR [HasGlobalDataPrivs]
GO

 CREATE  INDEX [IX_ChargeBook_Item] ON [dbo].[va_ChargeBook_Item]([MasterID]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_ChargeBook_Master_MemberID] ON [dbo].[va_ChargeBook_Master]([MemberID]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_ChargeBook_Master_OperatorCode] ON [dbo].[va_ChargeBook_Master]([Operator_Code]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_ChargeBook_Master_OperatorDate] ON [dbo].[va_ChargeBook_Master]([Operate_Date]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_ChargeBook_Master_ShopCode] ON [dbo].[va_ChargeBook_Master]([Shop_Code]) ON [PRIMARY]
GO

 CREATE  UNIQUE  INDEX [IX_ChargeBook_Master_BizNo] ON [dbo].[va_ChargeBook_Master]([BizNo]) ON [PRIMARY]
GO

 CREATE  UNIQUE  INDEX [IX_ChargeItem_Dict] ON [dbo].[va_ChargeItem_Dict]([Item_Code]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_ChargeItem_Dict2] ON [dbo].[va_ChargeItem_Dict]([Shop_Code]) ON [PRIMARY]
GO

 CREATE  UNIQUE  INDEX [IX_va_ChargeItem_Donate_Master] ON [dbo].[va_ChargeItem_Donate_Master]([BizNo]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_va_ChargeItem_Donate_Master2] ON [dbo].[va_ChargeItem_Donate_Master]([Shop_Code]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[va_ChargeItem_In_Items] ADD 
	CONSTRAINT [PK_VA_CHARGEITEM_IN_ITEMS] PRIMARY KEY  NONCLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

 CREATE  INDEX [IX_ChargeItem_In_Items] ON [dbo].[va_ChargeItem_In_Items]([MasterID]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_ChargeItem_In_Master] ON [dbo].[va_ChargeItem_In_Master]([Shop_Code]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[va_ChargeItem_Out_Items] ADD 
	CONSTRAINT [PK_VA_CHARGEITEM_OUT_ITEMS] PRIMARY KEY  NONCLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

 CREATE  INDEX [IX_ChargeItem_Out_Items] ON [dbo].[va_ChargeItem_Out_Items]([MasterID]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_ChargeItem_Out_Master] ON [dbo].[va_ChargeItem_Out_Master]([Shop_Code]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_va_ChargeItem_Stock] ON [dbo].[va_ChargeItem_Stock]([Shop_Code]) ON [PRIMARY]
GO

 CREATE  UNIQUE  INDEX [IX_va_ChargeItem_Stock2] ON [dbo].[va_ChargeItem_Stock]([Shop_Code], [Item_Code]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[va_ChargeItem_Stock_Book] ADD 
	CONSTRAINT [PK_VA_CHARGEITEM_STOCK_BOOK] PRIMARY KEY  NONCLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

 CREATE  INDEX [IX_ChargeItem_Stock_Book] ON [dbo].[va_ChargeItem_Stock_Book]([Item_Code], [Shop_Code]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Charge_DayAccount_Master] ON [dbo].[va_Charge_DayAccount_Master]([Operator_Code]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_PointCard_ChargeItems] ON [dbo].[va_Charge_Group_Items]([MasterID]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Charge_Item] ON [dbo].[va_Charge_Items]([MasterID]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[va_Charge_Master] ADD 
	CONSTRAINT [DF_va_Charge_Master_DataFrom] DEFAULT (1) FOR [DataFrom]
GO

 CREATE  INDEX [IX_va_Charge_Master] ON [dbo].[va_Charge_Master]([MemberID]) ON [PRIMARY]
GO

 CREATE  UNIQUE  INDEX [IX_va_Charge_Master2] ON [dbo].[va_Charge_Master]([BizNo]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_va_Charge_Master3] ON [dbo].[va_Charge_Master]([Shop_Code]) ON [PRIMARY]
GO

 CREATE  UNIQUE  INDEX [IX_Gift_Dict] ON [dbo].[va_Gift_Dict]([Item_Code]) ON [PRIMARY]
GO

 CREATE  UNIQUE  INDEX [IX_va_Gift_Donate_Master] ON [dbo].[va_Gift_Donate_Master]([BizNo]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_va_Gift_Donate_Master2] ON [dbo].[va_Gift_Donate_Master]([Shop_Code]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Gift_Exchanges] ON [dbo].[va_Gift_Exchange_Master]([MemberID]) ON [PRIMARY]
GO

 CREATE  UNIQUE  INDEX [IX_va_Gift_Exchange_Master2] ON [dbo].[va_Gift_Exchange_Master]([BizNo]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_va_Gift_Exchange_Master3] ON [dbo].[va_Gift_Exchange_Master]([Shop_Code]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[va_Gift_In_Items] ADD 
	CONSTRAINT [PK_VA_GIFT_IN_ITEMS] PRIMARY KEY  NONCLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

 CREATE  INDEX [IX_Gift_In_Items] ON [dbo].[va_Gift_In_Items]([MasterID]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Gift_In_Master] ON [dbo].[va_Gift_In_Master]([Shop_Code]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[va_Gift_Out_Items] ADD 
	CONSTRAINT [PK_VA_GIFT_OUT_ITEMS] PRIMARY KEY  NONCLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

 CREATE  INDEX [IX_Gift_Out_Items] ON [dbo].[va_Gift_Out_Items]([MasterID]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Gift_Out_Master] ON [dbo].[va_Gift_Out_Master]([Shop_Code]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_va_Gift_Stock] ON [dbo].[va_Gift_Stock]([Shop_Code]) ON [PRIMARY]
GO

 CREATE  UNIQUE  INDEX [IX_va_Gift_Stock2] ON [dbo].[va_Gift_Stock]([Shop_Code], [Item_Code]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[va_Gift_Stock_Book] ADD 
	CONSTRAINT [PK_VA_GIFT_STOCK_BOOK] PRIMARY KEY  NONCLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

 CREATE  INDEX [IX_Gift_Stock_Book] ON [dbo].[va_Gift_Stock_Book]([Item_Code], [Shop_Code]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Interface_MC_Items] ON [dbo].[va_Interface_MC_Items]([BizNo]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Interface_MC_Master] ON [dbo].[va_Interface_MC_Master]([BizNo]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Interface_MC_Payments] ON [dbo].[va_Interface_MC_Payments]([BizNo]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Member_Account_Book] ON [dbo].[va_Member_Account_Book]([MemberID]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[va_Member_BasicInfo] ADD 
	CONSTRAINT [DF_va_Member_BasicInfo_Total_Charge_Amount] DEFAULT (0) FOR [Total_Charge_Amount],
	CONSTRAINT [DF_va_Member_BasicInfo_Total_Withdraw_Amount] DEFAULT (0) FOR [Total_Withdraw_Amount],
	CONSTRAINT [DF_va_Member_BasicInfo_Total_Consume_Amount] DEFAULT (0) FOR [Total_Consume_Amount],
	CONSTRAINT [DF_va_Member_BasicInfo_Total_PointCardCharge_Amount] DEFAULT (0) FOR [Total_PointCardCharge_Amount],
	CONSTRAINT [DF_va_Member_BasicInfo_Total_PointCardConsume_Amount] DEFAULT (0) FOR [Total_PointCardConsume_Amount],
	CONSTRAINT [DF_va_Member_BasicInfo_Total_BeDonated_Amount] DEFAULT (0) FOR [Total_BeDonated_Amount],
	CONSTRAINT [DF_va_Member_BasicInfo_Total_DonatedConsume_Amount] DEFAULT (0) FOR [Total_DonatedConsume_Amount]
GO

 CREATE  INDEX [IX_Member_BasicInfo_MobileNo] ON [dbo].[va_Member_BasicInfo]([MobileNo]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Member_BasicInfo_CardNo] ON [dbo].[va_Member_BasicInfo]([CardNo]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_va_Member_ChargeItems] ON [dbo].[va_Member_ChargeItems]([MemberID]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Member_KeyInfo_Histories] ON [dbo].[va_Member_KeyInfo_Histories]([MemberID]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Member_PointCardCharges] ON [dbo].[va_Member_PointCardCharges]([MemberID]) ON [PRIMARY]
GO

 CREATE  UNIQUE  INDEX [IX_va_Member_PointCardCharges2] ON [dbo].[va_Member_PointCardCharges]([BizNo]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_va_Member_PointCardCharges3] ON [dbo].[va_Member_PointCardCharges]([Shop_Code]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Member_PointCards] ON [dbo].[va_Member_PointCards]([MemberID]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Member_Point_Book] ON [dbo].[va_Member_Point_Book]([MemberID]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[va_Member_WalletCharges] ADD 
	CONSTRAINT [PK_VA_MEMBER_WALLETCHARGES] PRIMARY KEY  NONCLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

 CREATE  INDEX [IX_Member_WalletCharges] ON [dbo].[va_Member_WalletCharges]([MemberID]) ON [PRIMARY]
GO

 CREATE  UNIQUE  INDEX [IX_va_Member_WalletCharges2] ON [dbo].[va_Member_WalletCharges]([BizNo]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_va_Member_WalletCharges3] ON [dbo].[va_Member_WalletCharges]([Shop_Code]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[va_Member_WalletWithdraw] ADD 
	CONSTRAINT [PK_VA_MEMBER_WALLETWITHDRAW] PRIMARY KEY  NONCLUSTERED 
	(
		[RID]
	)  ON [PRIMARY] 
GO

 CREATE  INDEX [IX_Member_WalletWithdraw] ON [dbo].[va_Member_WalletWithdraw]([MemberID]) ON [PRIMARY]
GO

 CREATE  UNIQUE  INDEX [IX_Member_WalletWithdraw2] ON [dbo].[va_Member_WalletWithdraw]([BizNo]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Member_WalletWithdraw3] ON [dbo].[va_Member_WalletWithdraw]([Shop_Code]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_ShopEx_Area] ON [dbo].[va_Place_Area]([father]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_ShopEx_City] ON [dbo].[va_Place_City]([father]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_PointCard_ChargeItems] ON [dbo].[va_PointCard_ChargeItems]([PointCard_ID]) ON [PRIMARY]
GO

 CREATE  UNIQUE  INDEX [IX_Point_Donate] ON [dbo].[va_Point_Donate]([BizNo]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Point_Donate2] ON [dbo].[va_Point_Donate]([Shop_Code]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_va_SMS_Send_Master] ON [dbo].[va_SMS_Send_Master]([Shop_Code]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[va_SMS_Send_Temp] ADD 
	CONSTRAINT [IX_SMS_Send_Temp2] UNIQUE  NONCLUSTERED 
	(
		[Session_ID],
		[MemberID]
	)  ON [PRIMARY] 
GO

 CREATE  INDEX [IX_SMS_Send_Temp] ON [dbo].[va_SMS_Send_Temp]([Session_ID]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_SMS_TelbookContactCategory_Dict] ON [dbo].[va_SMS_TelBookContactCategory_Dict]([Shop_Code]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_SMS_TelbookContacts] ON [dbo].[va_SMS_TelBookContacts]([Shop_Code]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[va_Sale_Strategies] ADD 
	CONSTRAINT [PK_VA_SALE_STRATEGIES] PRIMARY KEY  NONCLUSTERED 
	(
		[Strategy_Code]
	)  ON [PRIMARY] 
GO

 CREATE  UNIQUE  INDEX [IX_Voucher_Donate] ON [dbo].[va_Voucher_Donate]([BizNo]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Voucher_Donate2] ON [dbo].[va_Voucher_Donate]([Shop_Code]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Voucher_Released_Items] ON [dbo].[va_Voucher_Instances]([BelongTo_Shop_Code]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[ChaokersCN_SysMembership_Role_R_Privilege] ADD 
	CONSTRAINT [FK_ChaokersCN_SysMembership_Role_R_Privilege_ChaokersCN_SysMembership_Privileges] FOREIGN KEY 
	(
		[PrivilegeID]
	) REFERENCES [dbo].[ChaokersCN_SysMembership_Privileges] (
		[PrivilegeID]
	) ON DELETE CASCADE  ON UPDATE CASCADE ,
	CONSTRAINT [FK_T_ROLE_P_REFERENCE_T_ROLES] FOREIGN KEY 
	(
		[RoleID]
	) REFERENCES [dbo].[ChaokersCN_SysMembership_Roles] (
		[RoleID]
	) ON DELETE CASCADE  ON UPDATE CASCADE 
GO

ALTER TABLE [dbo].[ChaokersCN_SysMembership_User_R_Role] ADD 
	CONSTRAINT [FK_T_ADMINI_REFERENCE_T_ADMINI] FOREIGN KEY 
	(
		[UserID]
	) REFERENCES [dbo].[ChaokersCN_SysMembership_Users] (
		[UserID]
	) ON DELETE CASCADE  ON UPDATE CASCADE ,
	CONSTRAINT [FK_T_ADMINI_REFERENCE_T_ROLES] FOREIGN KEY 
	(
		[RoleID]
	) REFERENCES [dbo].[ChaokersCN_SysMembership_Roles] (
		[RoleID]
	) ON DELETE CASCADE  ON UPDATE CASCADE 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

create trigger tgr_SMS_AddToSendOut 
on va_SMS_Send_Items 
after insert 
as 

declare @MobileNo varchar(20)
declare @SourceID int
declare @MasterID int
declare @SMS_Content varchar(500)
declare @Planning_Send_Date datetime

select @SourceID=RID,@MobileNo=MobileNo,@MasterID=MasterID from inserted;
select @SMS_Content=SMS_Content,@Planning_Send_Date=Planning_Send_Date from va_SMS_Send_Master where RID=@MasterID

insert into va_SMS_SendOut(SourceID,MobileNo,SMS_Content,Planning_Send_Date)values(@SourceID, @MobileNo, @SMS_Content, @Planning_Send_Date)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

--短信发送失败后，更新 va_SMS_Send_Items 中短信发送成功/失败标记
create  trigger tgr_SMS_UpdateSendFlag_FAIL
on va_SMS_Sended_Fail
after insert 
as 

declare @SourceID int
select @SourceID=SourceID from inserted

--更新发送成功/失败标记
update va_SMS_Send_Items Set IS_SUC='0' where RID=@SourceID

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

--短信发送成功后，更新 va_SMS_Send_Items 中短信发送成功/失败标记
create  trigger tgr_SMS_UpdateSendFlag_SUC
on va_SMS_Sended_Suc 
after insert 
as 

declare @SourceID int
select @SourceID=SourceID from inserted

--更新发送成功/失败标记
update va_SMS_Send_Items Set IS_SUC='1' where RID=@SourceID

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

