Reports on user permissions for an object and includes SELECT, execute, and access permissions for a given object.
For additional syntax information for sp_helprotect, see the Microsoft SQL Server Transact-SQL Reference.
sp_helprotect [OwnerObject_Statement_Name_Pattern [, GranteeName [, GrantorName [, PermissionsCategories]]]]
where
For more information on the LIKE operator, see Wildcard Characters in the Microsoft SQL Server Transact-SQL Reference.
An object name of 'tb217[_]Customer' can be used to focus on one table. For a broader report use 'tb%' or '%cust%'. An owner name can be used to qualify the object name, such as in 'dbo.vwBudget' or 'Patia%.pc%'. A database name cannot be used as a qualifier in this parameter; instead, rely upon the current database context. The default is '%'.
Categories | Permissions |
---|---|
O | Object. |
S | Statement. |
OS | All categories are available (the default). |
The output report is sorted by permission category, owner, object, grantee, grantor, protection type category, protection type, action, and column sequential ID.
These are the special values that can appear in the report.
Value | Description |
---|---|
(All) | Indicates that the privilege covers all current columns of the object. |
(New) | Indicates that the privilege covers any new columns that might be altered (by using the ALTER statement) on the object in the future. |
(All+New) | Indicates a combination of All and New. |
The width of each column in the output report will be reduced to the length of the longest data value under each column. No data values are truncated.
If this procedure completes successfully, 0 is returned. If an error occurs, 1 is returned.
This example reports all permissions except those for DBO objects that begin with the letter T and grantor names that begin with the letter d.
sp_helprotect 'dbo.[^Tt]%',default,'[^d]%','O'
Execute permission is granted to the public group during installation or upgrade.