No Check foreign key constraint

  • Guys,

    Is there any way for me to list all the foreign keys in the database which are marked as 'no check'.

    ALTER TABLE [dbo].[EMPLOYEE] NOCHECK CONSTRAINT [FK_EMPLOYEE_JOB]

    SYSFOREIGNKEYS does not give that information.

    Any suggestions or inputs would help.

    Thanks

  • SELECT * FROM sys.foreign_keys

    WHERE is_disabled = 1

    Greg

  • When I create a FK with NOCHECK option then is_not_trusted is set to 1, in the sys.foreign_keys.

    Thanks.

    Mohit.

    [font="Arial"]---

    Mohit K. Gupta, MCITP: Database Administrator (2005), My Blog, Twitter: @SQLCAN[/url].
    Microsoft FTE - SQL Server PFE

    * Some time its the search that counts, not the finding...
    * I didn't think so, but if I was wrong, I was wrong. I'd rather do something, and make a mistake than be frightened and be doing nothing. :smooooth:[/font]

    How to ask for help .. Read Best Practices here[/url].

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply