Declare @TalentId nvarchar(10), @JobTalentPoolId nvarchar(20) SET NOCOUNT ON; begin tran Declare JobCollentTalentId Cursor for select TalentId,JobTalentPool.TalentPoolId from JobTalentPool where CreatorId=@FromUserId open JobCollentTalentId fetch next from JobCollentTalentId into @TalentId,@JobTalentPoolId while @@FETCH_STATUS=0 begin if(not exists(select * from JobTalentPool where CreatorId=@ToUserId and TalentId=@TalentId)) begin update JobTalentPool set CreatorId=@ToUserId where JobTalentPool.TalentPoolId=@JobTalentPoolId end end update Jobs set UserId=@ToUserId where UserId=@FromUserId delete from CompanyUsers where CompanyId=@CompanyId and PositionId in (select PositionId From Positions where UserId=@FromUserId) if(@@ERROR>0) begin RAISERROR(50001, 16, 1, '删除出错,请重试!') rollBack return -1 end commit tran return 0
这个存储过程一直执行,保服务器超时错误,到底什么原因望指教..
- 3 回答
- 0 关注
- 511 浏览
添加回答
举报
0/150
提交
取消