• 存储过程输出参数(不能添加重复数)


     1 ------------------------------------
     2 --用途:员工管理 
     3 --时间:2011-2-24 8:18:31
     4 ------------------------------------ 
     5 alter proc DKI_StaffManage
     6 (
     7    @CMD varchar(20)='',
     8    @staffcode varchar(50)='',
     9    @staffName varchar(50)='', 
    10    @flg int=0,              
    11    @returnvalues int=0 output
    12 )
    13 as
    14 begin tran
    15 if(@CMD='select')          
    16   begin  
    17       if(@flg=1) 
    18         begin   
    19            select top 100 * from Opt_DKI_Staff order by staffID desc
    20         end
    21        else if(@flg=2)   ---2为查询
    22          begin
    23           select * from Opt_DKI_Staff where 
    24          end 
    25   end     
    26 else if(@CMD='insert')
    27    begin    
    28   if (select count(*) from Opt_DKI_Staff where 0">StaffCode=@staffcode)>0
    29   begin     
    30     set @returnvalues=0         
    31   end 
    32   else
    33   begin 
    34     insert into Opt_DKI_Staff (StaffCode,StaffName) values (@staffcode,@staffName) 
    35     set @returnvalues=1   
    36   end 
    37    end
    38 else if(@CMD='update')
    39    begin     
    40    update Opt_DKI_Staff set where   
    41    end 
    42 else if(@CMD='delete')
    43   begin
    44   delete Opt_DKI_Staff where   
    45   end
    46 commit tran
    47 return
  • 相关阅读:
    市值
    01-HTML基础与进阶-day3-录像237
    01-HTML基础与进阶-day3-录像236
    01-HTML基础与进阶-day3-录像235
    01-HTML基础与进阶-day2-HTML第二讲
    01-HTML基础与进阶-day2-HTML第一讲
    01H5-fe-html5-006插入视频
    MySQL 备份和恢复数据
    MySQL 索引
    MySQL 视图
  • 原文地址:https://www.cnblogs.com/dqh123/p/9470086.html
Copyright © 2020-2023  润新知