--创建名为 GetStuCou_In 的有输入参数的存储过程
alter procedure GetStuCou_In
as
begin declare cur_update cursor
for
select provinceid,provincename from [T].[dbo].[T_z_temp]
open cur_update
declare @p_provinceid nvarchar(8)
declare @p_provincename nvarchar(20)
fetch from cur_update into @p_provinceid,@p_provincename
while(@@fetch_status=0)
begin
--select distinct provinceid from b_Institution where ProvinceID=@p_provinceid;
update T.dbo.t_delete_Z set ProvinceID =@p_provinceid where provincename=@p_provincename
PRINT @p_provinceid
PRINT @p_provincename
fetch from cur_update into @p_provinceid,@p_provincename
end
close cur_update
DEALLOCATE cur_update
end
--执行名为 GetStuCou_In 的有输入参数的存储过程(不传参数,即使用默认值)
--execute GetStuCou_In
--执行名为 GetStuCou_In 的有输入参数的存储过程(传入参数)
--execute GetStuCou_In '005'execute GetStuCou_In--drop procedure GetStuCou_In
alter procedure GetStuCou_In
as
begin declare cur_update cursor
for
select provinceid,provincename from [T].[dbo].[T_z_temp]
open cur_update
declare @p_provinceid nvarchar(8)
declare @p_provincename nvarchar(20)
fetch from cur_update into @p_provinceid,@p_provincename
while(@@fetch_status=0)
begin
--select distinct provinceid from b_Institution where ProvinceID=@p_provinceid;
update T.dbo.t_delete_Z set ProvinceID =@p_provinceid where provincename=@p_provincename
PRINT @p_provinceid
PRINT @p_provincename
fetch from cur_update into @p_provinceid,@p_provincename
end
close cur_update
DEALLOCATE cur_update
end
--执行名为 GetStuCou_In 的有输入参数的存储过程(不传参数,即使用默认值)
--execute GetStuCou_In
--执行名为 GetStuCou_In 的有输入参数的存储过程(传入参数)
--execute GetStuCou_In '005'execute GetStuCou_In--drop procedure GetStuCou_In