Comments and notes on SQL Server 2000, 2005, and T-SQL
Grant script for SQL procedures
DECLARE curVoids CURSOR FOR
select name
from sysobjects
where xtype = 'p'
DECLARE @vchrName varchar(100)
declare @msg varchar(1000)
OPEN curVoids
FETCH NEXT FROM curVoids INTO @vchrName
WHILE (@@fetch_status =0)
BEGIN
set @msg = 'grant exec on ' + rtrim (@vchrName) + ' to public'
print @msg
exec (@msg)
FETCH NEXT FROM curVoids INTO @vchrName
END
CLOSE curVoids
DEALLOCATE curVoids
About Steve Gray
Steve is a seasoned (translate: old) developer in VB and ASP.NET. He spends most of his time in Dynamics GP, writing custom mods for consulting firms. Crystal reports, eConnect, VS Tools for Dynamics... anything that comes along.