随笔 - 78, 评论 - 62, 访问 - 347670

导航


  • 访问:347670次
  • 积分:826分
  • 排名:第15名
  • 随笔:78篇
  • 评论:62条

随笔分类

随笔档案

相册

最新评论

阅读排行榜

评论排行榜

好饱 阅读(345) 评论(0)

-- 修改用户表权限

declare @roworder int
declare @name varchar(50)
declare @str varchar(500)
declare @cnt int
select identity(int,1,1) roworder ,name into #tmp1 from sysobjects where xtype = 'U' --and Name like 'Think_%'
select @cnt = count(*) from #tmp1
set @roworder = 1
while @roworder < = @cnt
begin
select @name = name from #tmp1 where roworder = @roworder
--print @name
set @str = 'grant execute on '+@name+ ' to 数据库用户名'
--print @str
exec(@str)
set @roworder = @roworder + 1
end

drop table #tmp1

 

 

-- 修改存储过程权限

declare @roworder int
declare @name varchar(50)
declare @str varchar(500)
declare @cnt int
select identity(int,1,1) roworder ,name into #tmp1 from sysobjects where xtype = 'p'
select @cnt = count(*) from #tmp1
set @roworder = 1
while @roworder < = @cnt
begin
select @name = name from #tmp1 where roworder = @roworder
--print @name
set @str = 'grant execute on '+@name+ ' to 数据库用户名'
--print @str
exec(@str)
set @roworder = @roworder + 1
end

drop table #tmp1


发表评论
切换编辑模式