我在触发器里写的:
execute("insert into Receive_"+@city+" (mobile,content,seatid) select top 1 '"+ @mobile+"','"+@content+"',seatid from seat_"+@city+"where DATEADD(minute,2,visittime) >getdate() order by assigntime")
怎样得知:有没有insert成功???
...全文
943打赏收藏
§如何获取执行结果?
我在触发器里写的: execute("insert into Receive_"+@city+" (mobile,content,seatid) select top 1 '"+ @mobile+"','"+@content+"',seatid from seat_"+@city+"where DATEADD(minute,2,visittime) >getdate() order by assigntime") 怎样得知:有没有insert成功???
execute("insert into Receive_"+@city+" (mobile,content,seatid) select top 1 '"+ @mobile+"','"+@content+"',seatid from seat_"+@city+"where DATEADD(minute,2,visittime) >getdate() order by assigntime")
if @@rowcount=0
print '注意:没有记录得到更新'
else print '已经更新了'