日期:2014-05-18 浏览次数:20572 次
SELECT AA,isnull((Select EID From OPENDATASOURCE( 'SQLOLEDB', 'Data Source=YC-ZXL\ZHANG;User ID=sa;Password=sa' ).exam.dbo.course WHERE UID=BB),'sdfsdf') BB FROM TTT GO insert into dbo.td_Accept_Errata ( SDate, EntRegNO, EntName, RemoveDept, Reason, OperateMan, RecordID, EntID, cCodeBar, RemoveMan, RemovePhone, SMan, SMode, SReason, SState, OperateDate, PassMan, IsValid, IsDW ) select top 10 Sdtate, EntRegID, EntName, DeptCode=(select code from codedb..tcdept a where removedeptcode=a.deptname), Reason, PassMan,replace(newid(),'-',''), isnull(Select entid From OPENDATASOURCE( 'SQLOLEDB', 'Data Source=服务器A;User ID=sa;Password=sa' ).库B.dbo.mytable my where dbo.Sheet2$.recordid=my.recordid ,myentid) ,'','$admin$','','','1','历史数据导入:同意勘误','5', Sdtate,'$admin$','1','0' from dbo.Sheet2$