create table shop_IPCategory (
   StartIP              int                  not null default 0,
   EndIP                int                  null default 0,
   country              nvarchar(200)        null default '',
   IPLocal              nvarchar(200)        null default '',
   City                 nvarchar(60)         null default '',
   constraint PK_SHOP_IPCATEGORY primary key nonclustered (StartIP)
)
 go 
create table shop_Links (
   GUIDCode             numeric              identity,
   imgURL               nvarchar(200)        null default '',
   linkText             nvarchar(20)         null default '',
   linkURL              nvarchar(200)        null default '',
   isImg                bit                  null default 0,
   isRecommend          bit                  null default 0,
   expireDate           datetime             null default getdate(),
   orderIndex           int                  null default 0,
   isTrash              bit                  null default 0,
   constraint PK_SHOP_LINKS primary key nonclustered (GUIDCode)
)
 go 
create table shop_SmsQueue (
   GUIDCode             numeric              identity,
   smsTitle             nvarchar(100)        null default '',
   smsContent           nvarchar(200)        null default '',
   receiptorMobi        varchar(15)          null,
   memberID             nvarchar(20)         null default '',
   creator              nvarchar(20)         null default '',
   createDate           datetime             null default getdate(),
   emailStatus          int                  null default 1,
   isTrash              bit                  null default 0,
   constraint PK_SHOP_SMSQUEUE primary key nonclustered (GUIDCode)
)
 go 
create table shop_account (
   GUIDCode             numeric              identity,
   memberID             nvarchar(20)         not null default '',
   occurTime            datetime             null default getdate(),
   recharge             money                null default 0,
   consume              money                null default 0,
   balance              money                null default 0,
   orderID              varchar(50)          null,
   handler              nvarchar(20)         null default '',
   remark               ntext                null default '',
   constraint PK_SHOP_ACCOUNT primary key nonclustered (GUIDCode)
)
 go 
create table shop_addressBook (
   GUIDCode             numeric              identity,
   memberID             nvarchar(20)         null default '',
   country              nvarchar(4)          null default '',
   province             nvarchar(100)        null default '',
   city                 nvarchar(50)         null default '',
   receiptorAdd         nvarchar(500)        null default '',
   receiptor            nvarchar(100)        null default '',
   receiptorTell        nvarchar(100)        null default '',
   receiptorMobi        varchar(100)         null default '',
   receiptorZip         varchar(20)          null default '',
   Email                varchar(100)         null default '',
   isDefault            bit                  null default 1,
   priBuilding          nvarchar(100)        null,
   invoiceTitle         nvarchar(200)        null default '',
   constraint PK_SHOP_ADDRESSBOOK primary key nonclustered (GUIDCode)
)
 go 
create table shop_admin (
   adminID              nvarchar(20)         not null default '',
   roleID               varchar(6)           not null default '',
   adminPwd             varchar(172)         not null default '',
   adminStatus          bit                  null default 1,
   creator              nvarchar(20)         null default '',
   createDate           datetime             null default getdate(),
   creatorIP            varchar(15)          null default '',
   IPLocation           nvarchar(200)        null default '',
   isSystem             bit                  null default 0,
   adminName            nvarchar(50)         null default '',
   lastLoginDate        datetime             null default getdate(),
   recentLoginDate      datetime             null default getdate(),
   remark               ntext                null default '',
   isApiUser            bit                  null default 0,
   constraint PK_SHOP_ADMIN primary key nonclustered (adminID)
)
 go 
create table shop_adminLog (
   GUIDCode             numeric              identity,
   adminID              nvarchar(20)         null default '',
   singInIp             varchar(15)          not null default '',
   ipLocation           nvarchar(200)        not null default '',
   logContent           ntext                null default '',
   logDate              datetime             null default getdate(),
   constraint PK_SHOP_ADMINLOG primary key nonclustered (GUIDCode)
)
 go 
create table shop_adminMenu (
   menuID               varchar(4)           not null,
   menuName             nvarchar(16)         not null default '',
   parentID             varchar(4)           not null default '',
   className            varchar(50)          null default '',
   webName              nvarchar(200)        null default '',
   orderIndex           int                  null default 0,
   constraint PK_SHOP_ADMINMENU primary key nonclustered (menuID)
)
 go 
create table shop_adminRole (
   roleID               varchar(6)           not null default '',
   roleName             nvarchar(10)         not null default '',
   createDate           datetime             null default getdate(),
   creator              nvarchar(20)         null default '',
   isSystem             bit                  null default 0,
   remark               ntext                null default '',
   constraint PK_SHOP_ADMINROLE primary key nonclustered (roleID)
)
 go 
create table shop_blogCate (
   cateID               varchar(8)           not null default '',
   parentID             varchar(6)           null default '',
   cateName             nvarchar(40)         null default '',
   isTrash              bit                  null default 0,
   orderIndex           int                  null default 0,
   constraint PK_SHOP_BLOGCATE primary key nonclustered (cateID)
)
 go 
create table shop_blogInTag (
   GUIDCode             numeric              identity,
   blogID               varchar(10)          null default '',
   tagID                varchar(6)           null default '',
   constraint PK_SHOP_BLOGINTAG primary key nonclustered (GUIDCode)
)
 go 
create table shop_blogTag (
   tagID                varchar(6)           not null default '',
   tagName              nvarchar(40)         null default '',
   constraint PK_SHOP_BLOGTAG primary key nonclustered (tagID)
)
 go 
create table shop_blogs (
   blogID               varchar(10)          not null default '',
   cateID               varchar(8)           null default '',
   tagID                varchar(6)           null default '',
   webTitle             nvarchar(200)        null default '',
   webKeyWord           nvarchar(200)        null default '',
   webDescript          nvarchar(300)        null default '',
   blogTitle            nvarchar(100)        null default '',
   blogBrief            nvarchar(300)        null default '',
   blogContent          ntext                null default '',
   postDate             datetime             null default getdate(),
   adminID              nvarchar(20)         null default '',
   orderIndex           int                  null default 0,
   isTrash              bit                  null default 0,
   viewTimes            int                  null default 0,
   sourceFrom           nvarchar(50)         null default '',
   constraint PK_SHOP_BLOGS primary key nonclustered (blogID)
)
 go 
create table shop_brand (
   brandID              varchar(10)          not null default '',
   brandName            nvarchar(50)         null default '',
   brandAlias           nvarchar(100)        null default '',
   brandImg             nvarchar(200)        null default '',
   brandImg2            nvarchar(200)        null default '',
   brandWebsite         varchar(200)         null default '',
   isRecommend          bit                  null default 0,
   brandDetails         ntext                null default '',
   orderIndex           int                  null default 0,
   isDisplay            bit                  null default 1,
   isTrash              bit                  null default 0,
   constraint PK_SHOP_BRAND primary key nonclustered (brandID)
)
 go 
create table shop_cartProducts (
   GUIDCode             numeric              identity,
   memberID             nvarchar(20)         null default '',
   cartID               varchar(20)          null default '',
   productID            varchar(50)          null default '',
   productName          nvarchar(200)        null default '',
   productSize          nvarchar(60)         null default '',
   productColor         nvarchar(60)         null default '',
   buyPrice             money                null default 0,
   buyQty               float                null default 1,
   addDate              datetime             null default getdate(),
   constraint PK_SHOP_CARTPRODUCTS primary key nonclustered (GUIDCode)
)
 go 
create table shop_comment (
   GUIDCode             numeric              identity,
   productID            varchar(50)          not null,
   memberID             nvarchar(20)         null default '',
   commentSubject       nvarchar(100)        null default '',
   commentRank          int                  null default 0,
   content              nvarchar(500)        null default '',
   postDate             datetime             null default getdate(),
   isChecked            bit                  null default 0,
   weighing             int                  null default 0,
   contact              nvarchar(100)        null default '',
   isTrash              bit                  null default 0,
   constraint PK_SHOP_COMMENT primary key nonclustered (GUIDCode)
)
 go 
create table shop_currencyList (
   currencyID           varchar(3)           not null default '',
   currencyName         nvarchar(20)         null default '',
   currencySymbol       nvarchar(10)         null default '',
   constraint PK_SHOP_CURRENCYLIST primary key nonclustered (currencyID)
)
 go 
create table shop_customPage (
   pageID               varchar(20)          not null default '',
   pageName             nvarchar(20)         null default '',
   pageKind             int                  null default 0,
   webTitle             nvarchar(200)        null default '',
   webKeyWord           nvarchar(200)        null default '',
   webDescript          nvarchar(300)        null default '',
   pageContent          ntext                null default '',
   isSample             bit                  null default 0,
   constraint PK_SHOP_CUSTOMPAGE primary key nonclustered (pageID)
)
 go 
create table shop_deliveryCompany (
   expressID            varchar(15)          not null default '',
   expressName          nvarchar(50)         null default '',
   expressWebsite       varchar(100)         null default '',
   orderIndex           int                  null default 0,
   isTrash              bit                  null default 0,
   transportCode        varchar(20)          null default '',
   constraint PK_SHOP_DELIVERYCOMPANY primary key nonclustered (expressID)
)
 go 
create table shop_deliveryFee (
   GUIDCode             numeric              identity,
   deliveryID           varchar(15)          null default '',
   subItem              int                  null default 1,
   province             nvarchar(100)        null default '',
   city                 nvarchar(50)         null default '',
   baseWeight           int                  null default 0,
   baseFee              money                null default 0,
   relWeight            int                  null default 0,
   relFee               money                null default 0,
   insureRate           int                  null default 0,
   minInsureFee         money                null default 0,
   isCOD                bit                  null default 0,
   isDefaultFee         bit                  null default 0,
   isAllSame            bit                  null default 0,
   constraint PK_SHOP_DELIVERYFEE primary key nonclustered (GUIDCode)
)
 go 
create table shop_deliveryManager (
   deliveryID           varchar(15)          not null default '',
   deliveryName         nvarchar(50)         null default '',
   expressID            varchar(15)          null default '',
   deliveryBrief        ntext                null default '',
   isDefault            bit                  null default 0,
   isTrash              bit                  null default 0,
   isCOD                bit                  null default 0,
   constraint PK_SHOP_DELIVERYMANAGER primary key nonclustered (deliveryID)
)
 go 
create table shop_emailQueue (
   GUIDCode             numeric              identity,
   emailTitle           nvarchar(100)        null default '',
   emailContent         text                 null default '',
   emailReceiptor       nvarchar(100)        null default '',
   memberID             nvarchar(20)         null default '',
   creator              nvarchar(20)         null default '',
   createDate           datetime             null default getdate(),
   emailStatus          int                  null default 1,
   isTrash              bit                  null default 0,
   constraint PK_SHOP_EMAILQUEUE primary key nonclustered (GUIDCode)
)
 go 
create table shop_emailTemplate (
   emailTemplateName    char(10)             not null default '',
   emailTitle           nvarchar(100)        null default '',
   emailContent         ntext                null default '',
   constraint PK_SHOP_EMAILTEMPLATE primary key nonclustered (emailTemplateName)
)
 go 
create table shop_errorNullPage (
   GUIDCode             numeric              identity,
   noAccessMsg          ntext                null default '',
   fileNotFoundMsg      ntext                null default '',
   NullMessage          ntext                null default '',
   generalErrMsg        ntext                null default '',
   constraint PK_SHOP_ERRORNULLPAGE primary key nonclustered (GUIDCode)
)
 go 
create table shop_expressBill (
   expressBillID        int                  not null default 0,
   expressBillName      nvarchar(30)         null,
   cssStyle             nvarchar(150)        null default '',
   exprexxBgImg         nvarchar(200)        null default '',
   isEnable             bit                  null default 1,
   constraint PK_SHOP_EXPRESSBILL primary key nonclustered (expressBillID)
)
 go 
create table shop_expressBillPosition (
   GUIDCode             numeric              identity,
   expressBillID        int                  null default 0,
   expressContName      nvarchar(30)         null default '',
   isReceipt            bit                  null,
   orderFieldName       nvarchar(30)         null default '',
   pointCoord           nvarchar(150)        null default '',
   isShow               bit                  null default 1,
   CusDefaultValue      varchar(50)          null default '',
   isCustom             bit                  null default 0,
   isBold               bit                  null default 0,
   fontSize             int                  null default 14,
   constraint PK_SHOP_EXPRESSBILLPOSITION primary key nonclustered (GUIDCode)
)
 go 
create table shop_favorite (
   GUIDCode             numeric              identity,
   memberID             nvarchar(20)         null default '',
   productID            varchar(50)          null,
   addDate              datetime             null default getdate(),
   orderExpire          datetime             null default getdate(),
   constraint PK_SHOP_FAVORITE primary key nonclustered (GUIDCode)
)
 go 
create table shop_flash (
   GUIDCode             numeric              identity,
   templateName         nvarchar(30)         null default '',
   flashID              varchar(3)           null default '',
   flashText            nvarchar(50)         null default '',
   imgURL               nvarchar(200)        null default '',
   linkURL              nvarchar(200)        null default '',
   orderIndex           int                  null default 0,
   isTrash              bit                  null default 0,
   constraint PK_SHOP_FLASH primary key nonclustered (GUIDCode)
)
 go 
create table shop_grabReg (
   regName              nvarchar(50)         not null default '',
   productIDReg         ntext                null default '',
   productNameReg       ntext                null default '',
   quotePriceReg        ntext                null default '',
   priceReg             ntext                null default '',
   imgReg               ntext                null default '',
   descriptReg          ntext                null default '',
   descImgReg           ntext                null default '',
   isDefault            bit                  null default 0,
   webCharset           varchar(20)          null default '',
   constraint PK_SHOP_GRABREG primary key nonclustered (regName)
)
 go 
create table shop_guestBook (
   GUIDCode             numeric              identity,
   memberID             nvarchar(20)         null default '',
   bookSubject          nvarchar(50)         null default '',
   bookContent          nvarchar(1000)       null default '',
   contact              nvarchar(100)        null default '',
   parentID             numeric              null default 0,
   bookTime             datetime             null default getdate(),
   isTrash              bit                  null default 0,
   constraint PK_SHOP_GUESTBOOK primary key nonclustered (GUIDCode)
)
 go 
create table shop_helperArticle (
   helperID             varchar(6)           not null default '',
   helperTitle          nvarchar(30)         null default '',
   parentID             varchar(6)           null default '',
   linkURL              nvarchar(200)        null default '',
   helperContent        ntext                null default '',
   isVisible            bit                  null default 1,
   orderIndex           int                  null default 0,
   isTrash              bit                  null default 0,
   constraint PK_SHOP_HELPERARTICLE primary key nonclustered (helperID)
)
 go 
create table shop_hotWord (
   GUIDCode             numeric              identity,
   searchKey            nvarchar(50)         null default '',
   orderIndex           int                  null default 0,
   constraint PK_SHOP_HOTWORD primary key nonclustered (GUIDCode)
)
 go 
create table shop_listShow (
   GUIDCode             numeric              identity,
   tableName            varchar(20)          null default '',
   adminID              nvarchar(20)         null default '',
   fieldName            nvarchar(30)         null default '',
   itemTitle            nvarchar(30)         null default '',
   isShow               bit                  null default 1,
   isOption             bit                  null default 1,
   orderIndex           int                  null default 0,
   constraint PK_SHOP_LISTSHOW primary key nonclustered (GUIDCode)
)
 go 
create table shop_manufacturer (
   manuID               varchar(10)          not null default '',
   manuName             nvarchar(50)         null default '',
   manuAddress          nvarchar(500)        null default '',
   manuWebsite          nvarchar(100)        null default '',
   manuContactor        nvarchar(50)         null default '',
   Email                varchar(100)         null default '',
   QQ                   nvarchar(20)         null default '',
   manuTell             varchar(25)          null default '',
   manuMobi             varchar(15)          null default '',
   manuBrief            ntext                null default '',
   isTrash              bit                  null default 0,
   constraint PK_SHOP_MANUFACTURER primary key nonclustered (manuID)
)
 go 
create table shop_member (
   memberID             nvarchar(20)         not null default '',
   memberPwd            varchar(172)         not null,
   memberEmail          varchar(100)         not null,
   memberStatus         int                  null default 0,
   levelID              varchar(5)           null default '',
   registerIP           varchar(15)          null default '',
   registerIPLocation   nvarchar(200)        null default '',
   registerDate         datetime             null default getdate(),
   activationCode       varchar(172)         null default '',
   isNew                bit                  null default 1,
   isTrash              bit                  null default 0,
   isWholesalers        bit                  null default 0,
   lastLoginDate        datetime             null default getdate(),
   memberPhoto          nvarchar(200)        null default '',
   expireDate           datetime             null default getdate(),
   constraint PK_SHOP_MEMBER primary key nonclustered (memberID)
)
 go 
create table shop_memberInfo (
   memberID             nvarchar(20)         not null default '',
   realName             nvarchar(50)         null default '',
   sex                  varchar(4)           null default '',
   birthday             varchar(19)          null default '',
   realAdd              nvarchar(500)        null default '',
   realZip              varchar(20)          null default '',
   realTel              varchar(25)          null default '',
   mobilCode            varchar(15)          null default '',
   QQ                   nvarchar(20)         null default '',
   ww                   nvarchar(50)         null default '',
   skype                nvarchar(50)         null default '',
   MSN                  nvarchar(50)         null default '',
   Yahoo                nvarchar(50)         null default '',
   ICQ                  nvarchar(50)         null default '',
   answer               nvarchar(50)         null default '',
   answerKey            nvarchar(50)         null default '',
   constraint PK_SHOP_MEMBERINFO primary key nonclustered (memberID)
)
 go 
create table shop_memberIntegral (
   GUIDCode             numeric              identity,
   memberID             nvarchar(20)         null default '',
   bookDate             datetime             null default getdate(),
   increase             int                  null default 0,
   changed              int                  null default 0,
   balance              int                  null default 0,
   remark               ntext                null default '',
   constraint PK_SHOP_MEMBERINTEGRAL primary key nonclustered (GUIDCode)
)
 go 
create table shop_memberLevel (
   levelID              varchar(5)           not null default '',
   levelName            nvarchar(20)         null default '',
   requiredIntegral     int                  null default 0,
   discountRate         int                  null default 100,
   isDefault            bit                  null default 0,
   levelKind            nvarchar(20)         null default '',
   isTrash              bit                  null default 0,
   constraint PK_SHOP_MEMBERLEVEL primary key nonclustered (levelID)
)
 go 
create table shop_onlineServer (
   serverID             varchar(50)          not null default '',
   cServerCode          ntext                null default '',
   orderIndex           int                  null default 0,
   isDisplay            bit                  null default 1,
   constraint PK_SHOP_ONLINESERVER primary key nonclustered (serverID)
)
 go 
create table shop_onlineTemplate (
   tmpID                int                  not null default 0,
   tmpName              nvarchar(20)         null default '',
   cssContent           ntext                null default '',
   tmpContent           ntext                null default '',
   replaceTmp           nvarchar(500)        null default '',
   isUse                bit                  null,
   constraint PK_SHOP_ONLINETEMPLATE primary key nonclustered (tmpID)
)
 go 
create table shop_oosBook (
   GUIDCode             numeric              identity,
   productID            varchar(50)          null default '',
   Email                varchar(100)         null default '',
   bookDate             datetime             null default getdate(),
   noticeDate           varchar(19)          null default '',
   isSent               bit                  null default 0,
   isTrash              bit                  null default 0,
   memberID             nvarchar(20)         null default '',
   constraint PK_SHOP_OOSBOOK primary key nonclustered (GUIDCode)
)
 go 
create table shop_order (
   orderID              varchar(50)          not null,
   paymentID            varchar(5)           null default '',
   deliveryID           varchar(15)          null default '',
   memberID             nvarchar(20)         null default '',
   receiptor            nvarchar(100)        null default '',
   country              nvarchar(200)        null default '',
   province             nvarchar(100)        null default '',
   city                 nvarchar(50)         null default '',
   receiptorAdd         nvarchar(500)        null default '',
   receiptorTell        nvarchar(100)        null default '',
   receiptorMobi        varchar(100)         null default '',
   receiptorZip         varchar(20)          null default '',
   Email                varchar(100)         null default '',
   invoiceTitle         nvarchar(200)        null default '',
   invoiceContent       varchar(200)         null default '',
   carriageSum          money                null default 0,
   productsSum          money                null default 0,
   adjustSum            money                null default 0,
   taxSum               money                null default 0,
   insuranceFee         money                null default 0,
   handlingCharge       money                null default 0,
   voucherID            varchar(20)          null default '',
   couponSum            money                null default 0,
   appointDate          varchar(50)          null default '',
   priBuilding          nvarchar(100)        null,
   orderIP              varchar(15)          null default '',
   orderIPLocation      nvarchar(200)        null default '',
   isNew                bit                  null default 1,
   orderStatus          int                  null default 0,
   payStatus            int                  null default 0,
   shippingStatus       int                  null default 0,
   orderDate            datetime             null default getdate(),
   isTrash              bit                  null default 0,
   orderTags            ntext                null default '',
   notePad              ntext                null default '',
   remark               ntext                null default '',
   constraint PK_SHOP_ORDER primary key nonclustered (orderID)
)
 go 
create table shop_orderLog (
   GUIDCode             numeric              identity,
   orderID              varchar(50)          null,
   logDate              datetime             null default getdate(),
   logContent           ntext                null default '',
   handler              nvarchar(20)         null default '',
   constraint PK_SHOP_ORDERLOG primary key nonclustered (GUIDCode)
)
 go 
create table shop_orderNote (
   GUIDCode             numeric              identity,
   orderID              varchar(50)          null,
   noteTitle            nvarchar(100)        null default '',
   noteDate             datetime             null default getdate(),
   noteContent          ntext                null default '',
   adminID              nvarchar(20)         null default '',
   constraint PK_SHOP_ORDERNOTE primary key nonclustered (GUIDCode)
)
 go 
create table shop_orderProducts (
   GUIDCode             numeric              identity,
   orderID              varchar(50)          null,
   productID            varchar(50)          null,
   buyPrice             money                null default 0,
   buyQty               float                null default 1,
   sentQty              float                null default 0,
   returnQty            float                null default 0,
   productSize          nvarchar(60)         null default '',
   productColor         nvarchar(60)         null default '',
   constraint PK_SHOP_ORDERPRODUCTS primary key nonclustered (GUIDCode)
)
 go 
create table shop_orderTag (
   GUIDCode             numeric              identity,
   tagName              nvarchar(40)         null default '',
   constraint PK_SHOP_ORDERTAG primary key nonclustered (GUIDCode)
)
 go 
create table shop_payLog (
   GUIDCode             numeric              identity,
   payDate              datetime             null default getdate(),
   receiptSum           money                null default 0,
   refundSum            money                null default 0,
   remark               ntext                null default '',
   constraint PK_SHOP_PAYLOG primary key nonclustered (GUIDCode)
)
 go 
create table shop_payNotify (
   transID              varchar(60)          not null default '',
   orderID              varchar(50)          null,
   memberID             nvarchar(20)         null default '',
   paymentID            varchar(5)           null default '',
   dealFunction         varchar(100)         null default '',
   isOrder              bit                  null default 0,
   transDate            datetime             null default getdate(),
   isSuccess            bit                  null default 0,
   constraint PK_SHOP_PAYNOTIFY primary key nonclustered (transID)
)
 go 
create table shop_payment (
   paymentID            varchar(5)           not null default '',
   paymentName          nvarchar(50)         null default '',
   payAccount           varchar(100)         null default '',
   parterID             varchar(50)          null default '',
   privateKey           varchar(200)         null default '',
   privateKey2          varchar(200)         null default '',
   payFee               float                null default 0,
   payMode              varchar(300)         null default '',
   payCurrency          varchar(200)         null default '',
   interfaceMode        varchar(300)         null default '',
   bankAccount          varchar(50)          null default '',
   privateKeyFile       varchar(200)         null default '',
   publicKeyiFile       varchar(200)         null default '',
   bankPublicKeyFile    varchar(200)         null default '',
   keyProtectPassword   varchar(200)         null default '',
   payBrief             ntext                null default '',
   processInterface     varchar(20)          null default '--',
   isDefault            bit                  null default 0,
   isCusAddress         bit                  null default 0,
   orderIndex           int                  null default 0,
   isTrash              bit                  null default 0,
   constraint PK_SHOP_PAYMENT primary key nonclustered (paymentID)
)
 go 
create table shop_power (
   powerID              varchar(3)           not null,
   powerName            nvarchar(20)         not null default '',
   parentID             varchar(3)           null default '0',
   menuID               varchar(4)           null,
   relWeb               nvarchar(30)         null default '',
   orderIndex           int                  null default 0,
   constraint PK_SHOP_POWER primary key nonclustered (powerID)
)
 go 
create table shop_productCate (
   categoryID           varchar(20)          not null default '',
   categoryName         nvarchar(30)         null default '',
   parentID             varchar(20)          null default '',
   orderIndex           int                  null default 0,
   isDisplay            bit                  null default 1,
   isTrash              bit                  null default 0,
   constraint PK_SHOP_PRODUCTCATE primary key nonclustered (categoryID)
)
 go 
create table shop_productColor (
   GUIDCode             numeric              identity,
   colorName            varchar(30)          null default '',
   valueName            nvarchar(30)         null,
   colorValue           varchar(20)          null default '',
   colorImg             nvarchar(200)        null default '',
   isImg                bit                  null default 0,
   orderIndex           int                  null default 0,
   constraint PK_SHOP_PRODUCTCOLOR primary key nonclustered (GUIDCode)
)
 go 
create table shop_productInCategory (
   GUIDCode             numeric              identity,
   productID            varchar(50)          null default '',
   categoryID           varchar(20)          null default '',
   constraint PK_SHOP_PRODUCTINCATEGORY primary key nonclustered (GUIDCode)
)
 go 
create table shop_productInTag (
   GUIDCode             numeric              identity,
   tagID                varchar(6)           null default '',
   productID            varchar(50)          null default '',
   constraint PK_SHOP_PRODUCTINTAG primary key nonclustered (GUIDCode)
)
 go 
create table shop_productSize (
   GUIDCode             numeric              identity,
   sizeName             nvarchar(20)         null default '',
   valueName            nvarchar(30)         null,
   sizeValue            varchar(10)          null default '',
   orderIndex           int                  null default 0,
   constraint PK_SHOP_PRODUCTSIZE primary key nonclustered (GUIDCode)
)
 go 
create table shop_productTag (
   tagID                varchar(6)           not null default '',
   tagName              nvarchar(40)         null default '',
   constraint PK_SHOP_PRODUCTTAG primary key nonclustered (tagID)
)
 go 
create table shop_products (
   productID            varchar(50)          not null default '',
   outProductID         varchar(50)          null default '',
   categoryID           varchar(20)          null default '',
   brandID              varchar(10)          null default '',
   manuID               varchar(10)          null default '',
   productName          nvarchar(200)        null default '',
   stockQty             float                null default 0,
   lowLimit             float                null default 0,
   upperLimit           float                null default 0,
   priceUnit            nvarchar(30)         null default '',
   soldQty              float                null default 100,
   quotePrice           money                null default 0,
   salePrice            money                null default 0,
   wholeSalePrice       money                null default 0,
   costPrice            money                null default 0,
   integral             int                  null default 0,
   productSize          nvarchar(60)         null default '',
   productColor         nvarchar(200)        null default '',
   productWeight        int                  null default 0,
   productBrief         nvarchar(1000)       null default '',
   productDetails       text                 null default '',
   isOnSale             bit                  null default 1,
   viewTimes            int                  null default 500,
   webTitle             nvarchar(200)        null default '',
   webKeyWord           nvarchar(200)        null default '',
   webDescript          nvarchar(300)        null default '',
   templateName         nvarchar(30)         null default '',
   isTemplate           bit                  null default 0,
   orderIndex           int                  null default 0,
   uploadDate           datetime             null default getdate(),
   miniWholesale        float                null default 1,
   maxWholesale         float                null default 0,
   isTrash              bit                  null default 0,
   isGift               bit                  null default 0,
   changeIntegral       int                  null default 0,
   htmlID               varchar(100)         null default '',
   imageBig             nvarchar(200)        null default '',
   imageMiddle          nvarchar(200)        null default '',
   imageSmall           nvarchar(200)        null default '',
   constraint PK_SHOP_PRODUCTS primary key nonclustered (productID)
)
 go 
create table shop_productsImg (
   GUIDCode             numeric              identity,
   productID            varchar(50)          null default '',
   imageSmall           nvarchar(200)        null default '',
   imageMiddle          nvarchar(200)        null default '',
   imageBig             nvarchar(200)        null default '',
   rawImg               nvarchar(200)        null default '',
   constraint PK_SHOP_PRODUCTSIMG primary key nonclustered (GUIDCode)
)
 go 
create table shop_receiptBill (
   receiptBillID        varchar(50)          not null default '',
   orderID              varchar(50)          null,
   receiptAccount       varchar(100)         null default '',
   currencyID           varchar(3)           null default '',
   receiptAmount        money                null default 0,
   paymentType          varchar(30)          null default '',
   recieptType          varchar(50)          null default '',
   receipter            nvarchar(50)         null default '',
   remark               ntext                null default '',
   invoiceTitle         nvarchar(200)        null default '',
   receiptDate          datetime             null default getdate(),
   handler              nvarchar(20)         null default '',
   bookDate             datetime             null default getdate(),
   txID                 varchar(50)          null default '',
   poundage             money                null default 0,
   exchangeRate         float                null default 0,
   isTrash              bit                  null default 0,
   isComplete           bit                  null default 0,
   constraint PK_SHOP_RECEIPTBILL primary key nonclustered (receiptBillID)
)
 go 
create table shop_refundBill (
   refundBillID         varchar(50)          not null default '',
   orderID              varchar(50)          null,
   refunder             nvarchar(50)         null default '',
   refunderAccount      varchar(100)         null default '',
   currencyID           varchar(3)           null default '',
   refundSum            money                null default 0,
   paymentType          varchar(30)          null default '',
   refundType           varchar(20)          null default '',
   refundBank           varchar(50)          null default '',
   deductIntegral       int                  null default 0,
   refundDate           datetime             null default getdate(),
   bookDate             datetime             null default getdate(),
   remark               ntext                null default '',
   handler              nvarchar(20)         null default '',
   isTrash              bit                  null default 0,
   isComplete           bit                  null default 0,
   constraint PK_SHOP_REFUNDBILL primary key nonclustered (refundBillID)
)
 go 
create table shop_relaCombination (
   GUIDCode             numeric              identity,
   productID            varchar(50)          null default '',
   relaProductID        varchar(50)          null default '',
   orderIndex           int                  null default 0,
   constraint PK_SHOP_RELACOMBINATION primary key nonclustered (GUIDCode)
)
 go 
create table shop_relaFittings (
   GUIDCode             numeric              identity,
   productID            varchar(50)          null default '',
   relaProductID        varchar(50)          null default '',
   orderIndex           int                  null default 0,
   constraint PK_SHOP_RELAFITTINGS primary key nonclustered (GUIDCode)
)
 go 
create table shop_relaProducts (
   GUIDCode             numeric              identity,
   productID            varchar(50)          null default '',
   relaProductID        varchar(50)          null default '',
   orderIndex           int                  null default 0,
   constraint PK_SHOP_RELAPRODUCTS primary key nonclustered (GUIDCode)
)
 go 
create table shop_returnBill (
   reshippingID         varchar(50)          not null default '',
   orderID              varchar(50)          null,
   deliveryID           varchar(15)          null default '',
   deliveryBillID       varchar(50)          null default '0',
   shippingFee          money                null default 0,
   insuranceFee         money                null default 0,
   returner             nvarchar(50)         null default '',
   returnAddress        nvarchar(500)        null default '',
   returnTel            varchar(25)          null default '',
   returnMobi           varchar(15)          null default '',
   returnZip            varchar(20)          null default '',
   returnReason         varchar(20)          null default '',
   returnDate           datetime             null default getdate(),
   bookDate             datetime             null default getdate(),
   remark               ntext                null default '',
   isTrash              bit                  null default 0,
   isComplete           bit                  null default 0,
   constraint PK_SHOP_RETURNBILL primary key nonclustered (reshippingID)
)
 go 
create table shop_returnProduct (
   GUIDCode             numeric              identity,
   reshippingID         varchar(50)          null default '',
   productID            varchar(50)          null default '',
   productColor         nvarchar(60)         null default '',
   productSize          nvarchar(60)         null default '',
   buyPrice             money                null default 0,
   returnQty            float                null default 0,
   constraint PK_SHOP_RETURNPRODUCT primary key nonclustered (GUIDCode)
)
 go 
create table shop_rolePower (
   GUIDCode             numeric              identity,
   roleID               varchar(6)           null default '',
   powerID              varchar(3)           null default '',
   isPrivilege          bit                  null default 0,
   constraint PK_SHOP_ROLEPOWER primary key nonclustered (GUIDCode)
)
 go 
create table shop_senderInfo (
   GUIDCode             numeric              identity,
   fromCity             nvarchar(30)         null default '',
   sender               nvarchar(50)         null default '',
   senderAddress        nvarchar(500)        null default '',
   senderCountry        nvarchar(4)          null default '',
   senderProvince       nvarchar(100)        null default '',
   senderCity           nvarchar(50)         null default '',
   senderTel            varchar(25)          null default '',
   senderMobil          varchar(15)          null default '',
   senderZip            varchar(20)          null default '',
   companyName          nvarchar(50)         null,
   isDefault            bit                  null default 0,
   constraint PK_SHOP_SENDERINFO primary key nonclustered (GUIDCode)
)
 go 
create table shop_shippingBill (
   shippBillID          varchar(50)          not null default '',
   receiptor            nvarchar(50)         null default '',
   receiptorAdd         nvarchar(500)        null default '',
   receiptorEmail       varchar(100)         null default '',
   receiptorMobi        varchar(15)          null default '',
   receiptorTell        varchar(25)          null default '',
   receiptorZip         varchar(20)          null default '',
   orderID              varchar(50)          null,
   deliveryID           varchar(15)          null default '',
   shippingFee          money                null default 0,
   insuranceFee         money                null default 0,
   deliveryBillID       varchar(50)          null default '0',
   shippingDate         datetime             null default getdate(),
   receiptDate          datetime             null default getdate(),
   isReceipt            bit                  null default 0,
   bookDate             datetime             null default getdate(),
   remark               ntext                null default '',
   isTrash              bit                  null default 0,
   isComplete           bit                  null default 0,
   constraint PK_SHOP_SHIPPINGBILL primary key nonclustered (shippBillID)
)
 go 
create table shop_shippingProduct (
   GUIDCode             numeric              identity,
   shippBillID          varchar(50)          null default '',
   productID            varchar(50)          null default '',
   productColor         nvarchar(60)         null default '',
   productSize          nvarchar(60)         null default '',
   buyPrice             money                null default 0,
   shippingQty          float                null default 0,
   constraint PK_SHOP_SHIPPINGPRODUCT primary key nonclustered (GUIDCode)
)
 go 
create table shop_siteBaseInfo (
   GUIDCode             numeric              identity,
   websiteName          nvarchar(100)        null default '',
   siteURL              varchar(100)         null default '',
   logoURL              nvarchar(200)        null default '',
   currencyName         nvarchar(10)         null default '',
   currencySymbol       nvarchar(10)         null default '',
   currencyText         nvarchar(10)         null default 'CNY',
   shopAddress          nvarchar(500)        null,
   shopTel              varchar(25)          null,
   shopMobi             varchar(15)          null default '',
   shopZip              varchar(20)          null,
   shopEmail            varchar(100)         null,
   shopICP              nvarchar(30)         null default '',
   openValidateCode     bit                  null default 1,
   openCoupon           bit                  null default 0,
   openMagnify          bit                  null default 0,
   openDiscount         bit                  null default 0,
   siteFooter           ntext                null default '',
   promptAgain          bit                  null default 1,
   jxcUrl               nvarchar(200)        null default '',
   adminID              nvarchar(20)         null default '',
   adminPwd             varchar(172)         null default '',
   constraint PK_SHOP_SITEBASEINFO primary key nonclustered (GUIDCode)
)
 go 
create table shop_siteImageSet (
   GUIDCode             numeric              identity,
   miniatureWidth       int                  null default 0,
   miniatureHeight      int                  null default 0,
   particularWidth      int                  null default 0,
   particularHeight     int                  null default 0,
   albumWidth           int                  null default 0,
   albumHeight          int                  null default 0,
   markText             nvarchar(50)         null default '',
   markTextPosition     int                  null default 0,
   markTextSize         int                  null default 9,
   markTextColor        nvarchar(7)          null default '#000000',
   markImg              nvarchar(200)        null default '',
   markImgPosition      int                  null default 0,
   transparence         int                  null default 100,
   watermark            int                  null default 0,
   miniatureDefaultImg  nvarchar(200)        null default '',
   particularDefaultImg nvarchar(200)        null default '',
   albumDefaultImg      nvarchar(200)        null default '',
   magnifier            bit                  null default 1,
   constraint PK_SHOP_SITEIMAGESET primary key nonclustered (GUIDCode)
)
 go 
create table shop_siteMessage (
   GUIDCode             numeric              identity,
   messageSubject       nvarchar(100)        null default '',
   messageContent       nvarchar(1000)       null default '',
   sender               nvarchar(20)         null default '',
   receiver             nvarchar(20)         null default '',
   postDate             datetime             null default getdate(),
   messageStatus        int                  null default 1,
   isTrash              bit                  null default 0,
   constraint PK_SHOP_SITEMESSAGE primary key nonclustered (GUIDCode)
)
 go 
create table shop_siteNotice (
   GUIDCode             numeric              identity,
   noticeTitle          varchar(50)          null default '',
   noticeContent        ntext                null default '',
   adminID              nvarchar(20)         null default '',
   orderIndex           int                  null default 0,
   postDate             datetime             null default getdate(),
   isChecked            bit                  null default 0,
   isTrash              bit                  null default 0,
   constraint PK_SHOP_SITENOTICE primary key nonclustered (GUIDCode)
)
 go 
create table shop_siteSEO (
   GUIDCode             numeric              identity,
   indexTitle           nvarchar(1000)       null default '',
   indexKey             nvarchar(1000)       null default '',
   indexDescript        nvarchar(1000)       null default '',
   constraint PK_SHOP_SITESEO primary key nonclustered (GUIDCode)
)
 go 
create table shop_siteSubject (
   siteSubjID           varchar(5)           not null default '',
   siteSubjName         nvarchar(50)         null default '',
   siteSubjURL          nvarchar(200)        null default '',
   siteSelect           nvarchar(500)        null default '',
   siteWhere            ntext                null default '',
   pageTarget           varchar(7)           null default '_self',
   isDisplay            bit                  null default 1,
   isURL                bit                  null default 0,
   siteSubTitle         nvarchar(1000)       null default '',
   siteSubKey           nvarchar(1000)       null default '',
   siteSubDescript      nvarchar(1000)       null default '',
   orderIndex           int                  null default 0,
   isTrash              bit                  null default 0,
   constraint PK_SHOP_SITESUBJECT primary key nonclustered (siteSubjID)
)
 go 
create table shop_siteTemplates (
   templateName         nvarchar(30)         not null default '',
   templateTitle        nvarchar(50)         null default '',
   appTheme             nvarchar(30)         null default '',
   isCurrent            bit                  null default 0,
   constraint PK_SHOP_SITETEMPLATES primary key nonclustered (templateName)
)
 go 
create table shop_smsSet (
   GUIDCode             numeric              identity,
   SMSUserID            varchar(30)          null default '',
   SMSPwd               varchar(30)          null default '',
   orderNotify          bit                  null default 0,
   memberNotify         bit                  null default 0,
   messageNotify        bit                  null default 0,
   payNotify            bit                  null default 0,
   managerMobi          varchar(200)         null default '',
   constraint PK_SHOP_SMSSET primary key nonclustered (GUIDCode)
)
 go 
create table shop_smtpSet (
   sendType             varchar(1)           not null default '0',
   yourEmail            varchar(50)          null default '',
   yourName             nvarchar(50)         null default '',
   smptServer           varchar(50)          null default '',
   smptPort             varchar(10)          null default '',
   smptUser             varchar(30)          null default '',
   smptPwd              varchar(30)          null default '',
   constraint PK_SHOP_SMTPSET primary key nonclustered (sendType)
)
 go 
create table shop_subscribe (
   Email                varchar(100)         not null default '',
   realName             nvarchar(50)         null default '',
   applicateDate        datetime             null,
   subscribeStatus      int                  null default 1,
   constraint PK_SHOP_SUBSCRIBE primary key nonclustered (Email)
)
 go 
create table shop_voucher (
   voucherID            varchar(20)          not null default '',
   voucherSum           money                null default 0,
   leastBuySum          money                null default 0,
   memberID             nvarchar(20)         null default '',
   creator              nvarchar(20)         null default '',
   createDate           datetime             null default getdate(),
   expiredDate          datetime             null default getdate(),
   IP                   varchar(15)          null default '',
   ipLocation           nvarchar(200)        null default '',
   voucherStatus        varchar(20)          null default '0',
   orderID              varchar(50)          null,
   isTrash              bit                  null default 0,
   remark               ntext                null default '',
   constraint PK_SHOP_VOUCHER primary key nonclustered (voucherID)
)
 go 
create table shop_webLayout (
   GUIDCode             numeric              identity,
   templateName         nvarchar(30)         null default '',
   webName              nvarchar(20)         null default '',
   moduleName           nvarchar(30)         null default '',
   moduleBrief          varchar(30)          null default '',
   modulePosition       varchar(5)           null default '',
   subModulePosition    varchar(50)          null default '',
   moduleTitle          nvarchar(20)         null default '',
   moduleCSS1           nvarchar(100)        null default '',
   moduleCSS2           nvarchar(100)        null default '',
   moduleContent        ntext                null default '',
   productTag           nvarchar(200)        null default '',
   displayCol           int                  null default 5,
   displayCount         int                  null default 10,
   isDisplay            bit                  null default 1,
   orderIndex           int                  null default 0,
   moduleType           int                  null default -1,
   isSystem             bit                  null default 0,
   isPublish            bit                  null default 0,
   editor               nvarchar(50)         null default '',
   constraint PK_SHOP_WEBLAYOUT primary key nonclustered (GUIDCode)
)
 go 
alter table shop_account
   add constraint FK_SHOP_ACC_MEMBERAND_SHOP_MEM foreign key (memberID)
      references shop_member (memberID)
         on delete cascade
 go 
alter table shop_addressBook
   add constraint FK_SHOP_ADD_MEMBERAND_SHOP_MEM foreign key (memberID)
      references shop_member (memberID)
         on delete cascade
 go 
alter table shop_blogInTag
   add constraint FK_SHOP_BLO_BLOGANDTA_SHOP_BLO foreign key (blogID)
      references shop_blogs (blogID)
         on delete cascade
 go 
alter table shop_memberInfo
   add constraint FK_SHOP_MEM_MEMBERMEM_SHOP_MEM foreign key (memberID)
      references shop_member (memberID)
         on delete cascade
 go 
alter table shop_memberIntegral
   add constraint FK_SHOP_MEM_MEMBERAND_SHOP_MEM foreign key (memberID)
      references shop_member (memberID)
         on delete cascade
 go 
alter table shop_orderProducts
   add constraint FK_SHOP_ORD_ORDERANDO_SHOP_ORD foreign key (orderID)
      references shop_order (orderID)
         on delete cascade
 go 
alter table shop_productInTag
   add constraint FK_SHOP_PRO_PROPROTAG_SHOP_PRO foreign key (productID)
      references shop_products (productID)
         on delete cascade
 go 
alter table shop_productsImg
   add constraint FK_SHOP_PRO_PRODUCTSA_SHOP_PRO foreign key (productID)
      references shop_products (productID)
         on delete cascade
 go 
alter table shop_relaFittings
   add constraint FK_SHOP_REL_PRODUCTSR_SHOP_PRO foreign key (productID)
      references shop_products (productID)
         on delete cascade
 go 
alter table shop_relaProducts
   add constraint FK_SHOP_REL_PRORELPRO_SHOP_PRO foreign key (productID)
      references shop_products (productID)
         on delete cascade
 go 
alter table shop_returnProduct
   add constraint FK_SHOP_RET_RETURNAND_SHOP_RET foreign key (reshippingID)
      references shop_returnBill (reshippingID)
         on delete cascade
 go 
alter table shop_rolePower
   add constraint FK_SHOP_ROL_ROLEANDRO_SHOP_ADM foreign key (roleID)
      references shop_adminRole (roleID)
         on delete cascade
 go 
alter table shop_shippingProduct
   add constraint FK_SHOP_SHI_SHIPPINGA_SHOP_SHI foreign key (shippBillID)
      references shop_shippingBill (shippBillID)
         on delete cascade
 go 
alter table shop_voucher
   add constraint FK_SHOP_VOU_MEMBERAND_SHOP_MEM foreign key (memberID)
      references shop_member (memberID)
         on delete cascade