Scripting all permissions in a SQL Server database is not trivial. Discover how to generate the necessary statements yourself with this simple query. (Well, copy & paste of the query is simple…)
Are you looking to identify your effective permissions in SQL Server, the permissions actually in effect after taking things like denies or role membership into account? Read on to see how sys.fn_my_permissions can help.
The sys.fn_builtin_permissions catalog function returns a result set that contains one row for each possible permission that you can grant (or deny) in SQL Server. Read on to find out how to use it and how to interpret the results.
The sys.server_permissions catalog view can be used to identify active server permissions, permissions with server scope that have been granted or denied to a server principal. Read on to find out how to interpret the output of this catalog view.
The sys.database_permissions catalog view can be used to identify active database permissions that are defined in the current database. Read on to find out how to interpret the output of this catalog view.