存储过程的增删改

就比如写一个存储过程对学生表进行你说的操作吧,Options是操作选项。
create procedure OperationData @Options Int,@StuId VarChar(10),@StuNameVarChar(8)
 as
 begin
  if Options=0 --选项参数值0执行删除操作
   delete Student where Student .StuId=@StuId
  else ifI Options=1 --选项参数值为1则执行修改操作


   begin
   updata Student 
    set Student .StuId=@StuId
    set Student.StuName = @StuName where  Student.StuId=@StuId
   end


  else if  Options=2
  insert into Student values(StuId, StuName)E 

   end

原文地址:https://www.cnblogs.com/Tianxf815/p/8859098.html