Azure sql database -some FK check constraints automatically change to nocheck

Puppala, Sreedhar 0 Reputation points
2026-09-09T20:44:48.4533333+00:00

Azure sql database -some FK check constraints automatically change to nocheck , no alter was applied , checked audit log as well.anyone faced similiar issue

Azure SQL Database
0 comments No comments

1 answer

Sort by: Oldest
  1. Erland Sommarskog 137.3K Reputation points MVP Volunteer Moderator
    2026-09-09T20:56:53.82+00:00

    No, that did not happen automatically. Someone ran some commands. The user may not have explicitly execute ALTER TABLE commands, but it may have happened implicitly because of some operation.

    If you did not have proper auditing in place to capture DDL commands, it's difficult to find out what happened.

    The easiest way to track such events is to set up an DDL trigger:

    CREATE TRIGGER ddltri ON DATABASE 
       FOR DDL_DATABASE_LEVEL_EVENTS AS
    INSERT ddlaudit(evendata, time, username)
        SELECT eventdata(), sysdatetime(), USER
    

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.