Skip to content

Commit 8e70e5d

Browse files
authored
Merge pull request #3580 from Tisit/Issue3578
sp_Blitz: Check 191 avoid false positives in case user doesn't have permissions on sys.master_files
2 parents 8fdf5f1 + 1a73cb4 commit 8e70e5d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sp_Blitz.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6105,6 +6105,8 @@ IF @ProductVersionMajor >= 10
61056105
FROM #SkipChecks
61066106
WHERE DatabaseName IS NULL AND CheckID = 191 )
61076107
AND (SELECT COUNT(*) FROM sys.master_files WHERE database_id = 2) <> (SELECT COUNT(*) FROM tempdb.sys.database_files)
6108+
/* User may have no permissions to see tempdb files in sys.master_files. In that case count returned will be 0 and we want to skip the check */
6109+
AND (SELECT COUNT(*) FROM sys.master_files WHERE database_id = 2) <> 0
61086110
BEGIN
61096111

61106112
IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 191) WITH NOWAIT

0 commit comments

Comments
 (0)