资源描述:
《旧版数据导入新版数据方法》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、旧版数据导入新版数据方法.txt21春暖花会开!如果你曾经历过冬天,那么你就会有春色!如果你有着信念,那么春天一定会遥远;如果你正在付出,那么总有一天你会拥有花开满圆。2010.01.17龙岗数据转新版数据旧数据库类型A旧数据库类型B先备份新旧数据库,然后升级1.DEPART----tbDepartment31------------->0其它不变改表与DOCTORUSER关联,因此要修正DOCTORUSER.DEPARTIDSQL语句如下旧数据库类型A:DELETEFROMMedImgMgrSysLG.dbo
2、.tbDepartment;DELETEFROMEndoscopeLG.dbo.DEPARTWHEREDEPARTID=-1;UPDATEEndoscopeLG.dbo.DEPARTSETDEPARTID=0WHEREDEPARTID=31;UPDATEEndoscopeLG.dbo.DOCTORUSERSETDEPARTID=0WHEREDEPARTID=31;INSERTMedImgMgrSysLG.dbo.tbDepartment(DepartmentID,DepartmentName)SELECTDEP
3、ARTID,DEPARTDESCFROMEndoscopeLG.dbo.DEPART;2.DOCTORUSER----tbDoctor(1)LEVELCODE-----AuthCode255------------->10231------------->12------------->563(2)LOGINPWD-----LoginPasswd(3)WORKID-----WorkIDDOCTORUSER.WorkID=tbDoctor.WORKID+1000???(4)HIRESTATUS-----HireS
4、tatusDOCTORUSER.Status=tbDoctor.HIRESTATUS-1(5)SEX-----Sex0------------->11------------->22------------->0(6)DUTYID-----DutyIDDOCTORUSER.DutyID=tbDoctor.DUTYID-1(7)CNNAME-----LoginName,NameCNDOCTORUSER.LoginName=tbDoctor.CNNAMEDOCTORUSER.NameCN=tbDoctor.CNNA
5、ME(8)DEPARTID-----DepartmentIDDOCTORUSER.DepartmentID=tbDoctor.DEPARTIDSQL语句如下旧数据库类型A:首先修改LEVELCODE类型由tinyint改为int,然后执行UPDATEEndoscopeLG.dbo.DOCTORUSERSETLEVELCODE=1023WHERELEVELCODE=255;UPDATEEndoscopeLG.dbo.DOCTORUSERSETLEVELCODE=563WHERELEVELCODE=2;UPDATE
6、EndoscopeLG.dbo.DOCTORUSERSETSEX=SEX+1;UPDATEEndoscopeLG.dbo.DOCTORUSERSETSEX=0WHERESEX=3;UPDATEEndoscopeLG.dbo.DOCTORUSERSETHIRESTATUS=HIRESTATUS;UPDATEEndoscopeLG.dbo.DOCTORUSERSETDUTYID=DUTYID-1;INSERTMedImgMgrSysLG.dbo.tbDoctor(WorkID,DepartmentID,LoginN
7、ame,LoginPasswd,AuthCode,HireStatus,DutyID,Sex)SELECTWORKID,DEPARTID,CNNAME,ISNULL(LOGINPWD,''),LEVELCODE,ISNULL(HIRESTATUS,0),DUTYID,SEXFROMEndoscopeLG.dbo.DOCTORUSER;3.tbPatientInformation-----PATIENTE,PATIENTSELF(1)MedicalID-------PATIENTSELF.MEDICCAREID(
8、2)InHospitalID------PATIENTSELF.INHOSPITAL(3)OutPatientID------IF(PATIENTSELF.INHOSTPITAL==NULL)IDPATIENTSELF.SICKBEDIDELSENULL(4)CheckID------该表的CheckID根据旧版数据库的版本情况,由两种可能[1]图片按PATIENTSELF.ENDSC