mysql导入数据库报366_管家婆普及版sql数据库如何导入366++版数据库

根据上面的数据库语句,我需要将管家婆普及版2013tr的数据库导出到excel表。然后倒入tr2014管家婆辉煌366++数据库。具体操作如下:

2013excel数据表导入tryl2014数据库有37个表出现错误分别是:大概有数据的有:

areatype atypecw btype goodsstocks inigoodsstocks ptype t_gbl_actionlist t_gbl_datatypelist t_gbl_fieldtypelist t_gbl_functionlist t_gbl_messagelist t_gbl_rightkind t_gbl_stringlist v_atypename v_atypewidz v_btypearap v_btypename v_btypeotherarap v_ptypecalc v_ptypename v_ptypename2 vchtype view_zz_vchbalance zerotype

倒表语句实用存下:对照2013excel导出的所有表项。

use tr2014

set IDENTITY_INSERT areatype ON

insert into areatype(Leveal,SonNum,SonCount,UserCode,Name,FullName,Comment,Deleted,Rec,ParRec,namepy) select Leveal,SonNum,SonCount,UserCode,Name,FullName,Comment,Deleted,Rec,ParRec,namepy from 天润2013新.dbo.areatype

set IDENTITY_INSERT areatype off

ptype_index 一个主键 删掉索引后导入数据,然后在工具——管理索引重建一个索引

use tr2014

set IDENTITY_INSERT ptype ON

insert into ptype(typeId,ParId,leveal,sonnum,soncount,CanModify,UserCode,FullName,Name,Standard,Type,Area,Unit1,Unit2,UnitRate1,UnitRate2,preprice1,preprice2,preprice3,preprice4,UsefulLifeMonth,UsefulLifeDay,Comment,recPrice,deleted,costmode,Namepy,warnup,warndown,Rec,ParRec,barcode)

select typeId,ParId,leveal,sonnum,soncount,CanModify,UserCode,FullName,Name,Standard,Type,Area,Unit1,Unit2,UnitRate1,UnitRate2,preprice1,preprice2,preprice3,preprice4,UsefulLifeMonth,UsefulLifeDay,Comment,recPrice,deleted,costmode,Namepy,warnup,warndown,Rec,ParRec,barcode from 天润2013新.dbo.ptype

set IDENTITY_INSERT ptype off

goodsstockindex 2个主键

use tr2014x

insert into goodsstocks(PtypeId,KtypeId,JobNumber,OutFactoryDate,Qty,Price,Total,GoodsOrder)

select PtypeId,KtypeId,JobNumber,OutFactoryDate,Qty,Price,Total,GoodsOrder from 天润2013新.dbo.goodsstocks

use tr2014x

insert into inigoodsstocks(PtypeId,KtypeId,JobNumber,OutFactoryDate,Qty,Price,Total,GoodsOrder)

select PtypeId,KtypeId,JobNumber,OutFactoryDate,Qty,Price,Total,GoodsOrder from 天润2013新.dbo.inigoodsstocks

btypeidx 1个主键唯一索引

use tr2014x

set IDENTITY_INSERT btype ON

insert into btype(typeId,parid,leveal,soncount,sonnum,UserCode,FullName,Name,Area,TelAndAddress,PostCode,Person,TaxNumber,BankAndAcount,Comment,ARTotal,APTotal,ARTotal00,APTotal00,deleted,Namepy,Rec,ParRec,AreaTypeID,fax)

select typeId,parid,leveal,soncount,sonnum,UserCode,FullName,Name,Area,TelAndAddress,PostCode,Person,TaxNumber,BankAndAcount,Comment,ARTotal,APTotal,ARTotal00,APTotal00,deleted,Namepy,Rec,

ParRec,AreaTypeID,fax from 天润2013新.dbo.btype

set IDENTITY_INSERT btype off

ptype有唯一主键索引无法导入,删除索引ptype_index后导入,然后重建索引。

下面的SQL语句对students表在sid上添加PRIMARY KEY索引。

ALTER TABLE ptype ADD PRIMARY KEY (typeId)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值