mssql server把数据库教程全数客商存款和储蓄进程的EXEC权限赋另一剧中人物

威澳门尼斯人36366com 1

declare @name varchar(8000)
declare cursor_a cursor for select  name from sysobjects  where
xtype=’U’
威澳门尼斯人36366com,open  cursor_a
fetch next from cursor_a into @name
while @@fetch_status=0
begin 
  exec(‘delete from  ‘+@name)
  fetch next  from cursor_a into @name
end
close cursor_a
deallocate cursor_a

$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 ‘+@user+ ‘. ‘+@name+ ‘ to ‘+@username) fetch next from
t_cursor into @user,@name end close t_cursor deallocate t_cursor
end go;

威澳门尼斯人36366com 2

威澳门尼斯人36366com 3

Author

发表评论

电子邮件地址不会被公开。 必填项已用*标注