Skip to content

Instantly share code, notes, and snippets.

@ademar
Created October 30, 2014 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ademar/dcb5cd2fdd832fc34baa to your computer and use it in GitHub Desktop.
Save ademar/dcb5cd2fdd832fc34baa to your computer and use it in GitHub Desktop.
Generate GRANT statements for stored procedures (SQL Server 2000)
DECLARE @User varchar(50)
SELECT @User = 'myuser'
SELECT
'GRANT EXEC ON ' + name + ' TO ' + @User
FROM
sysobjects
WHERE
type = 'P'
AND category = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment