Site Search:
Sign in | Join | Help
4Penny.net

SQL Server (T-SQL)

Comments and notes on SQL Server 2000, 2005, and T-SQL

4penny Thursday, December 07, 2006

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

Comments

 

ASPDOTNETSTOREFRONT said:

You need to extract the latest zip (pro.7...) file from the aspdotnetstorefront folder. This can take

March 9, 2007 4:03 PM [Delete]

Leave a Comment

(required)  
(optional)
(required)  
Add

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.