Skip to content

Commit

Permalink
Merge pull request #3523 from BrentOzarULTD/3522_sp_BlitzIndex_permis…
Browse files Browse the repository at this point in the history
…sions

#3522 sp_BlitzIndex permissions
  • Loading branch information
BrentOzar committed May 22, 2024
2 parents 30cfd48 + ac6531e commit ffc7d39
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
9 changes: 7 additions & 2 deletions Install-All-Scripts.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22809,8 +22809,13 @@ OPTION (RECOMPILE);';
AND ic.object_id = sed.referenced_id )
OPTION(RECOMPILE);'

INSERT #FilteredIndexes ( database_id, database_name, schema_name, table_name, index_name, column_name )
EXEC sp_executesql @dsql, @params = N'@i_DatabaseName NVARCHAR(128)', @i_DatabaseName = @DatabaseName;
BEGIN TRY
INSERT #FilteredIndexes ( database_id, database_name, schema_name, table_name, index_name, column_name )
EXEC sp_executesql @dsql, @params = N'@i_DatabaseName NVARCHAR(128)', @i_DatabaseName = @DatabaseName;
END TRY
BEGIN CATCH
RAISERROR (N'Skipping #FilteredIndexes population due to error, typically low permissions.', 0,1) WITH NOWAIT;
END CATCH
END;
END;

Expand Down
9 changes: 7 additions & 2 deletions Install-Azure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16008,8 +16008,13 @@ OPTION (RECOMPILE);';
AND ic.object_id = sed.referenced_id )
OPTION(RECOMPILE);'

INSERT #FilteredIndexes ( database_id, database_name, schema_name, table_name, index_name, column_name )
EXEC sp_executesql @dsql, @params = N'@i_DatabaseName NVARCHAR(128)', @i_DatabaseName = @DatabaseName;
BEGIN TRY
INSERT #FilteredIndexes ( database_id, database_name, schema_name, table_name, index_name, column_name )
EXEC sp_executesql @dsql, @params = N'@i_DatabaseName NVARCHAR(128)', @i_DatabaseName = @DatabaseName;
END TRY
BEGIN CATCH
RAISERROR (N'Skipping #FilteredIndexes population due to error, typically low permissions.', 0,1) WITH NOWAIT;
END CATCH
END;
END;

Expand Down
9 changes: 7 additions & 2 deletions sp_BlitzIndex.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2502,8 +2502,13 @@ OPTION (RECOMPILE);';
AND ic.object_id = sed.referenced_id )
OPTION(RECOMPILE);'

INSERT #FilteredIndexes ( database_id, database_name, schema_name, table_name, index_name, column_name )
EXEC sp_executesql @dsql, @params = N'@i_DatabaseName NVARCHAR(128)', @i_DatabaseName = @DatabaseName;
BEGIN TRY
INSERT #FilteredIndexes ( database_id, database_name, schema_name, table_name, index_name, column_name )
EXEC sp_executesql @dsql, @params = N'@i_DatabaseName NVARCHAR(128)', @i_DatabaseName = @DatabaseName;
END TRY
BEGIN CATCH
RAISERROR (N'Skipping #FilteredIndexes population due to error, typically low permissions.', 0,1) WITH NOWAIT;
END CATCH
END;
END;

Expand Down

0 comments on commit ffc7d39

Please sign in to comment.