Granting Execute Rights to Public - 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 [' + + '].['  + + '] to public'
    sysobjects o
    inner join sysusers u 
        on o.uid = u.uid
where 1=1
    and o.type in ('FN','P')
    and not like 'dt_%'
order by 1