Query execute permissions on stored procs



I've recently been tasked with duplicating the permissions from one
account to another. We have a development, system test, and production

SQL Server, and approximately 35 databases in each. We use a fine
level of control on this particular account because it's what the
applications use to log in.

I've granted datareader/datawriter to the new account for all the dbs.
Each db, however, has a ton of stored procedures. Not all of them are
executable by the original account. I found a script that grants
access to all user stored procs, which is ok and will save me a few
days worth of point-and-click - but I'd be a happier DBA if I could
find a way to query the execute permissions on the stored procs to copy

them to the new account.


Any ideas? Below is the script I've used so far on the dev server.


SELECT 'GRANT EXECUTE ON ' + NAME + ' TO MyLogin' -- Replace MyLogin
with the name of your new Login
FROM SYSOBJECTS
WHERE TYPE = 'P'
AND LEFT(NAME,2) <> 'sp' -- system procs
AND LEFT(NAME,2) <> 'dt' -- VSS procs


Thanks,
Bill
A.K.A. PSPDBA

.



Relevant Pages

  • Re: Execute Persmission denied on object sp_OACreate
    ... If so what access and permissions. ... The account is a windows account. ... One method to test permissions is to log in to your SQL Server box using the ... >>> SA account password and gaining access to the database. ...
    (microsoft.public.sqlserver.security)
  • Re: Specifying a logon account for SQL Server 2005 services
    ... As I mentioned using a Windows domain account with no permissions is the ... configured only for very specific server and memory configurations. ... account to use while installing SQL Server, will SQL Server give this account ...
    (microsoft.public.sqlserver.security)
  • Re: simple security question (need refresher)
    ... If IIS is configured for anonymous access and you connect to SQL Server ... using Windows authentication, the IIS anonymous account ... this account or roles that this account is a member of. ... Permissions are required only on objects directly accessed by the ...
    (microsoft.public.sqlserver.security)
  • Re: "Access denied" with xp_cmdshell (!)
    ... But problem is that I have tried to give for that account full control ... restart Sql Server for those permissions to take effect. ...
    (microsoft.public.sqlserver.security)
  • Re: Incoming E-Mail - cant create contact in OU
    ... account out of local administrator to attempt to find any denied access. ... I then added full permissions to my user account on both of these keys, ... local admin rights to the server hosting incoming email. ... what permission I need to give the app pool locally to avoid this issue. ...
    (microsoft.public.sharepoint.windowsservices)