§如何获取执行结果?

blackwind 2004-08-11 06:36:48
我在触发器里写的:
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成功???
...全文
95 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
47522341 2004-08-12
  • 打赏
  • 举报
回复
@@rowcount,
上條查詢語句執行后影響的紀錄條數.
yesterday2000 2004-08-11
  • 打赏
  • 举报
回复
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 '已经更新了'
blackwind 2004-08-11
  • 打赏
  • 举报
回复
就是有数据插入了?

34,577

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧