Skip to content

Commit f669e1b

Browse files
committed
For #3816
1 parent 2caf971 commit f669e1b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

sp_BlitzLock.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,12 @@ BEGIN
205205
THEN 0
206206
ELSE 1
207207
END,
208+
@CanReadMSDB bit =
209+
(
210+
SELECT COUNT(1)
211+
FROM fn_my_permissions(N'msdb.dbo.sysjobsteps', N'OBJECT') AS fmp
212+
WHERE fmp.permission_name = N'SELECT'
213+
),
208214
@d varchar(40) = '',
209215
@StringToExecute nvarchar(4000) = N'',
210216
@StringToExecuteParams nvarchar(500) = N'',
@@ -2131,6 +2137,7 @@ BEGIN
21312137
(
21322138
@Azure = 0
21332139
AND @RDS = 0
2140+
AND @CanReadMSDB = 1
21342141
)
21352142
BEGIN
21362143
SET @StringToExecute =

0 commit comments

Comments
 (0)