Skip to content

sp_BlitzWho - don't fail if login doesn't have SELECT permission on msdb.dbo.sysjobs #3814

@VladDBA

Description

@VladDBA

Is your feature request related to a problem? Please describe.
If executed by a login that doesn't have SELECT permissions on msdb.dbo.sysjobs sp_BlitzWho will end up erroring out with:

The SELECT permission was denied on the object 'sysjobs', database 'msdb', schema 'dbo'.

Describe the solution you'd like
Add a check for SELECT permissions on msdb.dbo.sysjobs and use that flag similarly to how @Platform is used to decide if the the msdb.dbo.sysjobs portion should be added to the dynamic T-SQL.

The minimum permissions required to run sp_BlitzWho are now:

  • VIEW SERVER PERFORMANCE STATE
  • EXECUTE ON sp_BlitzWho

The only downside when running sp_BlitzWho without SELECT permission on msdb.dbo.sysjobs is that the program_name column will contain the job id instead of its name for sessions originating from SQL Server Agent.

Image

Describe alternatives you've considered
Not backporting fixes I've made for PSBlitz, but that doesn't feel right/fair.

Are you ready to build the code for the feature?
Yup, PR incoming as soon as I file this issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions