declare @group varchar(128)
set @group = 'mygroup'
select 'Grant '+ Case when xtype = 'U' then 'INSERT, UPDATE, DELETE'
else 'EXECUTE' end + ' ON ' + name + ' TO ' + @group
from sysobjects
where
xtype in( 'U','P')
and crdate> '20050101'
and ObjectProperty(id,'IsMSShipped') = 0