火玫瑰蜘蛛,年年好节节高,异界海盗王下载
简单实用游标更改数据
alter proc updatestudent @id int, @id2 int as declare @schoolid int declare @classid int declare @studentid int declare @idnumber int declare @idaaa int begin declare feeinsertstudent cursor for select stuid,schid,clasid from t_school where id=@id open feeinsertstudent fetch next from feeinsertstudent into @schoolid,@classid,@studentid while @@fetch_status=0 begin set @idnumber=(select count(*) from t_leaveschool where studentid=@studentid and schoolid=@schoolid and classid=@classid) set @idaaa=(select count(*) from t_leaveschool where id=@id2) if(@idnumber!=0) if(@idaaa!=0) begin update t_leaveschool set studentid=@studentid,classid=@classid,schoolid=@studentid where id=@id2 end fetch next from feeinsertstudent into @schoolid,@classid,@studentid end close feeinsertstudent deallocate feeinsertstudent end
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
数据库SQL---数据库、基本表、视图、索引的定义、修改、删除
在 Azure CentOS VM 中配置 SQL Server 2019 AG - (上)
在 Azure CentOS VM 中配置 SQL Server 2019 AG - (下)
网友评论