打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
循环一个表
declare @field1 int
declare @field2 int
declare cur CURSOR LOCAL for
   
select field1, field2 from sometable where someotherfield is null

open cur

fetch next from cur into @field1, @field2

while @@FETCH_STATUS = 0 BEGIN

   
--execute your sproc on each row
   
exec uspYourSproc @field1, @field2

   
fetch next from cur into @field1, @field2
END

close cur
deallocate cur
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
清除指定数据库SLEEPING状态的连接
Kill掉访问某个数据库的连接
SQL实现交叉表的方法
sql server 脚本收集
sqlserver刷新视图
sql 基本游标
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服