--数据库批量执行存储过程

 

CREATE procedure [dbo].[BIdata]--创建一个名为findName的存储过程
AS
declare @result VARCHAR(100)--用来处理结果的变量
declare @begindate VARCHAR(100)
declare @enddate VARCHAR(100)
set @begindate = CONVERT(varchar(100), GETDATE(), 23)
set @enddate= CONVERT(varchar(100), GETDATE(), 23)

begin
--声明一个游标
Declare curStudentFee Cursor for
select name from dbo.sysobjects where OBJECTPROPERTY(id, N'IsProcedure') = 1 and name like 'BI[_]Data[_]%' order by name ;---查询语句(查询所有用户存储过程名称)

--打开游标
Open curStudentFee
--循环并提取记录
Fetch Next From curStudentFee Into @result--取第一条记录存入@result中
While ( @@Fetch_Status=0 )
begin
exec @result @begindate,@enddate;---处理结果
Fetch Next From curStudentFee into @result----下一条
end
--关闭游标
Close curStudentFee
--释放游标
Deallocate curStudentFee
end

posted on 2020-08-12 14:54  周庆明  阅读(924)  评论(0编辑  收藏  举报
jQuery火箭图标返回顶部代码

jQuery火箭图标返回顶部代码

滚动滑动条后,查看右下角查看效果。很炫哦!!

适用浏览器:IE8、360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗.