In SQL many times we need to provide execute permission to all stored procedure for specific user for any database. To achieve this you can make the execute statement by below query.
The query for it is just simple:
The query for it is just simple:
SELECT 'Grant Execute on ' + name + ' SQLServerUSERName'FROM sysobjects WHERE xtype IN ('P')
For tables and views:
SELECT 'Grant select,insert,update,delete on ' + name + ' SQLServerUSERName''
from sysobjects where xtype in ('U','V')'