资源描述:
《旧版数据导入新版数据方法》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、2010.01.17龙岗数据转新版数据旧数据库类型A旧数据库类型B先备份新旧数据库,然后升级1.DEPART----tbDepartment31------------->0其它不变改表与DOCTORUSER关联,因此要修正DOCTORUSER.DEPARTIDSQL语句如下旧数据库类型A:DELETEFROMMedImgMgrSysLG.dbo.tbDepartment;DELETEFROMEndoscopeLG.dbo.DEPARTWHEREDEPARTID=-1;UPDATEEndoscopeLG.dbo.DEPARTSETDEPART
2、ID=0WHEREDEPARTID=31;UPDATEEndoscopeLG.dbo.DOCTORUSERSETDEPARTID=0WHEREDEPARTID=31;INSERTMedImgMgrSysLG.dbo.tbDepartment(DepartmentID,DepartmentName)SELECTDEPARTID,DEPARTDESCFROMEndoscopeLG.dbo.DEPART;2.DOCTORUSER----tbDoctor(1)LEVELCODE-----AuthCode255------------->10231--
3、----------->12------------->563(2)LOGINPWD-----LoginPasswd(3)WORKID-----WorkIDDOCTORUSER.WorkID=tbDoctor.WORKID+1000???(4)HIRESTATUS-----HireStatusDOCTORUSER.Status=tbDoctor.HIRESTATUS-1(5)SEX-----Sex0------------->11------------->22------------->0(6)DUTYID-----DutyIDDOCTOR
4、USER.DutyID=tbDoctor.DUTYID-1(7)CNNAME-----LoginName,NameCNDOCTORUSER.LoginName=tbDoctor.CNNAMEDOCTORUSER.NameCN=tbDoctor.CNNAME(8)DEPARTID-----DepartmentIDDOCTORUSER.DepartmentID=tbDoctor.DEPARTIDSQL语句如下旧数据库类型A:首先修改LEVELCODE类型由tinyint改为int,然后执行UPDATEEndoscopeLG.dbo.DOCTORU
5、SERSETLEVELCODE=1023WHERELEVELCODE=255;UPDATEEndoscopeLG.dbo.DOCTORUSERSETLEVELCODE=563WHERELEVELCODE=2;UPDATEEndoscopeLG.dbo.DOCTORUSERSETSEX=SEX+1;UPDATEEndoscopeLG.dbo.DOCTORUSERSETSEX=0WHERESEX=3;UPDATEEndoscopeLG.dbo.DOCTORUSERSETHIRESTATUS=HIRESTATUS;UPDATEEndoscopeLG
6、.dbo.DOCTORUSERSETDUTYID=DUTYID-1;INSERTMedImgMgrSysLG.dbo.tbDoctor(WorkID,DepartmentID,LoginName,LoginPasswd,AuthCode,HireStatus,DutyID,Sex)SELECTWORKID,DEPARTID,CNNAME,ISNULL(LOGINPWD,''),LEVELCODE,ISNULL(HIRESTATUS,0),DUTYID,SEXFROMEndoscopeLG.dbo.DOCTORUSER;3.tbPatientI
7、nformation-----PATIENTE,PATIENTSELF(1)MedicalID-------PATIENTSELF.MEDICCAREID(2)InHospitalID------PATIENTSELF.INHOSPITAL(3)OutPatientID------IF(PATIENTSELF.INHOSTPITAL==NULL)IDPATIENTSELF.SICKBEDIDELSENULL(4)CheckID------该表的CheckID根据旧版数据库的版本情况,由两种可能[1]图片按PATIENTSELF.ENDSCPI
8、D存放的要对同一机台号的同一天的病例进行处理,生成RECORDCDNO然后同[2]处理[2]图片按PATIENTSELF.RECORDCDNO存放的CheckID-