SELECT 'GRANT EXECUTE ON[dbo].[' + name + ']TO [user]' AS t_sql
FROM sys.procedures
得到的腳本直接批量執行即可:
GRANT EXECUTE ON[dbo].[sp1]TO [user]
GRANT EXECUTE ON[dbo].[sp2]TO [user]
GRANT EXECUTE ON[dbo].[sp3l]TO [user]
GRANT EXECUTE ON[dbo].[sp4]TO [user]
GRANT EXECUTE ON[dbo].[sp5]TO [user]
GRANT EXECUTE ON[dbo].[sp6]TO [user]