34,590
社区成员
发帖
与我相关
我的任务
分享
CREATE proc P_int800_WeiXinUpdateTaskLog
@i int output
AS
BEGIN
begin try
select top(100)s_id,taskid,url,guid,click,reply
into #t
from [DB55INS1].Subentry.dbo.T_Subentry_WeiXinTask with(nolock)
where s_id in (38,381) and status = 2
order by s_id asc
end try
begin catch
insert into T_int800_WeiXinErrorid(errormsg,type)
select left(error_message(),100),'log'
end catch
select @i = COUNT(1) from #t
insert into T_int800_WeiXinTaskLog(s_id,taskid,url,guid,click,reply)
select s_id,taskid,url,guid,click,reply from #t
update [DB55INS1].Subentry.dbo.T_Subentry_WeiXinTask
set status = 3
where taskid in(select taskid from #t)
END
from [DB55INS1].Subentry.dbo.T_Subentry_WeiXinTask nolock
select a.*
FROM OPENDATASOURCE(
'SQLOLEDB',
'Data Source=''ip'';User ID=''sa'';Password=''123456'''
).库.dbo.表a
实在不行就这么写呗~~