您的位置:首页 > 其它

存储过程,把查询结果赋给变量

2006-07-27 15:59 357 查看
declare upcur cursor for
select (datediff(day,@st_date,@ed_date)+1)-2*datediff(ww,@st_date,@ed_date) --每月要输的天数,没考虑节假日
open upcur --打开
fetch next from upcur into @work_days
select @work_days
fetch next from upcur into @work_days
close upcur --关
deallocate upcur
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: