Wednesday, 15 June 2011

How to filter sp_helprotect information

DECLARE @sp_helprotect TABLE 
( 
    [Owner] VARCHAR(255), 
    [Object] VARCHAR(255) NULL, 
    [Grantee] VARCHAR(255) NULL, 
    [Grantor] VARCHAR(255) NULL,     
    [ProtectType] VARCHAR(255) NULL, 
    [Action] VARCHAR(255) NULL, 
    [Column] VARCHAR(255) NULL
) 
 
INSERT @sp_helprotect EXEC sp_helprotect 
SELECT * FROM @sp_helprotect
WHERE [Object] = 'table-name'
 ORDER BY [Object], [Grantee], [Action]

No comments:

Post a Comment