mssql server把所有用户存储过程的exec权限赋另一角色
$sql=”create procedure sp_GrantProce(@username varchar(40)) as begin declare @user varchar(20),@name varchar(40) declare t_cursor cursor for select user_name(uid) as users,name from sysobjects where (xtype= ‘P ‘ or xtype= ‘X ‘) and status> 0 open t_cursor fetch next from t_cursor into @user,@name while @@fetch_status=0 begin exec( ‘grant execute on + ‘. + ‘ to ) fetch next from t_cursor into @user,@name end close t_cursor deallocate t_cursor end go”;
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。
发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/1837164.html