Skip to content

Commit 8691608

Browse files
authored
Merge pull request BrentOzarULTD#3929 from BrentOzarULTD/copilot/fix-cascading-updates-warning
sp_BlitzIndex: suppress Cascading Updates/Deletes warning for zero-write objects
2 parents 9742259 + 448db6d commit 8691608

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

sp_BlitzIndex.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5986,6 +5986,14 @@ BEGIN
59865986
FROM #ForeignKeys fk
59875987
WHERE ([delete_referential_action_desc] <> N'NO_ACTION'
59885988
OR [update_referential_action_desc] <> N'NO_ACTION')
5989+
AND EXISTS (
5990+
SELECT 1/0
5991+
FROM #IndexSanity i
5992+
WHERE i.object_id = fk.parent_object_id
5993+
AND i.database_id = fk.database_id
5994+
AND i.schema_name = fk.schema_name
5995+
AND i.user_updates > 0
5996+
)
59895997
OPTION ( RECOMPILE );
59905998

59915999
RAISERROR(N'check_id 72: Unindexed foreign keys.', 0,1) WITH NOWAIT;

0 commit comments

Comments
 (0)