Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Granting Execute Rights to Public - SQL Server

RSS
Modified on Wed, Jan 28, 2009, 7:22 PM by Administrator Categorized as SQL Server
The following SQL will generate the SQL statements that will grant execute rights to PUBLIC for all functions and stored procedures.

select distinct 
    sql = 'grant execute on [' + u.name + '].['  + o.name + '] to public'
from 
    sysobjects o
    inner join sysusers u 
        on o.uid = u.uid
where 1=1
    and o.type in ('FN','P')
    and o.name not like 'dt_%'
order by 1

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.