我想让某登录用户仅仅具有执行某个数据库的全部存储过程权限,应该怎么办?在安全性-->用户,那里新建一个用户,只对一个数据库有操作的权限.如果你还想设置改用户对表、存储过程的权限,请在用户的属性--》权限下去设置。

解决方案 »

  1.   

    --增加执行过程权限
    declare @min int
    declare @max int
    declare @str char(120)
    declare @table varchar(40)declare  @tem table(
          NO int identity(1,1),
          name varchar(40)
    )
    insert @tem select name from sysobjects where  type in('P')select @min=1,@max=max(NO) from @tem
    while @min<=@max begin
       select @table=name from @tem where NO=@min
       select @str=' grant execute on [dbo].['+@table+'] to 用户'
       exec (@str)
       select @min=@min+1
    end
    go