Skip to content

Commit ac79de5

Browse files
committed
Issue #3334 sp_Blitz Fails because of permissions
1 parent a015e05 commit ac79de5

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

sp_Blitz.sql

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,9 @@ AS
196196
,@SkipXPCMDShell bit = 0
197197
,@SkipMaster bit = 0
198198
,@SkipMSDB bit = 0
199-
,@SkipModel bit = 0
199+
,@SkipModel BIT = 0
200200
,@SkipTempDB bit = 0
201-
,@SkipValidateLogins bit = 0
202-
,@SkipModelCheck BIT = 0;
201+
,@SkipValidateLogins bit = 0;
203202

204203
DECLARE
205204
@db_perms table
@@ -322,16 +321,16 @@ AS
322321
FROM model.sys.objects
323322
)
324323
BEGIN
325-
SET @SkipModelCheck = 0; /*We have read permissions in the model database, and can view the objects*/
324+
SET @SkipModel = 0; /*We have read permissions in the model database, and can view the objects*/
326325
END;
327326
END TRY
328327
BEGIN CATCH
329-
SET @SkipModelCheck = 1; /*We have read permissions in the model database ... oh wait we got tricked, we can't view the objects*/
328+
SET @SkipModel = 1; /*We have read permissions in the model database ... oh wait we got tricked, we can't view the objects*/
330329
END CATCH;
331330
END;
332331
ELSE
333332
BEGIN
334-
SET @SkipModelCheck = 1; /*We don't have read permissions in the model database*/
333+
SET @SkipModel = 1; /*We don't have read permissions in the model database*/
335334
END;
336335
END;
337336

@@ -497,7 +496,7 @@ AS
497496
SELECT
498497
v.*
499498
FROM (VALUES(NULL, 29, NULL)) AS v (DatabaseName, CheckID, ServerName) /*Looks for user tables in model*/
500-
WHERE @SkipModelCheck = 1;
499+
WHERE @SkipModel = 1;
501500

502501
INSERT #SkipChecks (DatabaseName, CheckID, ServerName)
503502
SELECT

0 commit comments

Comments
 (0)