SDU Tools: Script Database Object Permissions in SQL Server T-SQL
As part of our free SDU Tools for developers and DBAs, we have many scripting functions. Moving or recreating object-level permissions between SQL Server databases can be time consuming. To allow scripting these out, we’ve added a tool called ScriptDatabaseObjectPermissions.
It’s a stored procedure (as it has to change databases) and takes a single parameter: @DatabaseName (sysname) as the name of the database whose object permissions you want to script.
2020-01-15