sp_helprotect System Stored Procedure

For SQL Server 6.5 information, see sp_helprotect in What's New for SQL Server 6.5.

Reports permissions by database object and, optionally, by user for that object.

Syntax

sp_helprotect name [, username]

where

name
Is the name of a table, view, stored procedure, user, or group in the current database.
username
Is a username in the current database.

Remarks

Executing sp_helprotect reports permissions on a database object. If the username parameter is supplied, only that user's permissions on the database object are reported. If name is a user or group and username is also supplied, the permissions for the user or group are listed.

The procedure looks for objects and users in the current database only.

Examples

A.    Permissions for a Table

This example reports the permissions for the titles table.

sp_helprotect titles
B.    Permissions for a User

This example lists all permissions that Judy has in the database.

sp_helprotect Judy

Permission

Execute permission defaults to the public group.

Tables Used

master.dbo.spt_values, syscolumns, sysobjects, sysprotects, sysusers

See Also

GRANT statement sp_help
REVOKE statement