One of the questions asked in my SQL Server Automation &
SQL SMO session at the 2006 PASS
Community Summit was "when an object is being scripted in SQL
Server Management Studio (SSMS) how can the permissions for the
object be scripted". I had a mental blank and could not remember off the
top of my head, as did everyone else in the session. The permissions
can be scripted in SSMS for an objects by using the Wizard in
SSMS by Right Clicking on a database and selecting Tasks | Generate Scripts as
illustrated below: