RE: SP execute only permissions

From: Christian Donner (ChristianDonner_at_discussions.microsoft.com)
Date: 06/13/05


Date: Mon, 13 Jun 2005 03:16:01 -0700


"Craig HB" schrieb:

> I want to give a user execute permissions on all the stored procedures in a
> database and nothing else. Is there a fixed database role that I can use, or
> do I need to grant the user permissions for each stored procedure manually ?
>
> Thanks,
> Craig

declare @object varchar(256)
declare cu cursor fast_forward for
   select [name] from sysobjects where [xtype] = 'P'
open cu
fetch next from cu into @object
while @@fetch_status = 0
begin
   execute('grant execute on [' + @object + '] to MyUser')
   fetch next from cu into @object
end
close cu deallocate cu



Relevant Pages

  • RE: Execute permission for all sprocs
    ... "Craig HB" schrieb: ... Just add the name of the user account in the second line and run this: ... declare @sp varchar ... fetch next from cu into @sp ...
    (microsoft.public.sqlserver.security)
  • Re: yum prob on lappy
    ... Glad Craig got you on your way. ... The updated repos are sent with the distribution so all you ... have to do is fetch the file ... Robert McBroom ...
    (Fedora)