zoukankan      html  css  js  c++  java
  • 权限

    ALTER PROCEDURE [dbo].[AddRoleRight]
    (
        @menuinfostr VARCHAR(max),
        @role INT
    )
    AS
      declare @StrSeprate varchar(2)
      set @StrSeprate=','
      declare   @ch int -- as   varchar(max)     
     
      begin tran --开始执行事务
      set   @menuinfostr=@menuinfostr+@StrSeprate      
      --过滤空格和换行
      select  @menuinfostr=replace(replace(@menuinfostr,char(32),''),char(13)+char(10),'')
     DELETE  FROM  dbo.MMS_Roleright WHERE RoleId=@role;
      while(@menuinfostr<>'')     
                      begin     
                      set   @ch=left(@menuinfostr,charindex(',',@menuinfostr,1)-1)
                          
                        --print @ch;
                          INSERT INTO MMS_Roleright ( RoleId, MenuId) VALUES(@role,@ch );

     
      set   @menuinfostr=stuff(@menuinfostr,1,charindex(',',@menuinfostr,1),'')     
      --print @menuinfostr;
                      end    
                      
                      
       if @@error<>0
    begin rollback tran
    end
    else  
    begin commit tran
    end   

  • 相关阅读:
    Wix Burn:如何将32位和64位的安装包制作成一个安装包
    禁止32位安装包运行在64位操作系统上
    图片校验码
    Oracle建表命令
    npm系列
    git使用
    syslog
    hibernate配置enum枚举属性
    httpClient发送post请求
    修改ubuntu系统语言
  • 原文地址:https://www.cnblogs.com/zhangweixin/p/3977816.html
Copyright © 2011-2022 走看看