SC005
Published 20 November 2017
The procedure grants itself permissions
The procedure grants itself permissions. This may indicate that a GO is missing.
Consider the following:
|
In the above example, if GO is omitted before the GRANT statement, the procedure will be created with the GRANT statement included as part of its body, and no rights will be granted during script execution. It is very unusual for a stored procedure to legitimately grant rights to itself, which is why this pattern should be flagged.