Script to Create a Script Granting EXECUTE to all Stored Procs in a DB


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. DECLARE @USER VARCHAR(50)
  2. SELECT @USER = 'UserOrRole'
  3.  
  4. SELECT
  5. 'GRANT EXEC ON ' + name + ' TO ' + @USER
  6. FROM
  7. sysobjects
  8. WHERE
  9. TYPE = 'P'
  10. AND category = 0

URL: http://www.geekzilla.co.uk/View2356DC3A-9F53-4A95-9849-C4518B8E1F92.htm

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.