计划任务出错
- SQL code
begindeclare @id intdeclare @id2 intdeclare youbiao cursor for select id from Db_TranRD where ExitTime is null and carid is not nullopen youbiaofetch next from youbiao into @idwhile(@@fetch_status=0)beginprint @id set @id2='select trid from Db_Alarm where trid=@id' if @id2 is null begin print @id2fetch next from youbiao into @idendendclose youbiao deallocate youbiaoend
提示 消息 245,级别 16,状态 1,第 10 行
在将 varchar 值 'select trid from Db_Alarm where trid=@id' 转换成数据类型 int 时失败。
[解决办法]
[解决办法]
- SQL code
begindeclare @id intdeclare @id2 intdeclare youbiao cursor for select id from Db_TranRD where ExitTime is null and carid is not nullopen youbiaofetch next from youbiao into @idwhile(@@fetch_status=0)beginprint @id select @id2=trid from Db_Alarm where trid=@id if @id2 is null begin print @id2fetch next from youbiao into @idendendclose youbiao deallocate youbiaoend--你应该是这个意思
[解决办法]
果然是押输了,最近好勤快。
[解决办法]
declare @id2 int
set @id2='select trid from Db_Alarm where trid=@id'
消息 245,级别 16,状态 1,第 2 行
在将 varchar 值 'select trid from Db_Alarm where trid=@id' 转换成数据类型 int 时失败。