locked
SQL03159: WITH CHECK | NOCHECK option for existing data check enforcement is ignored

    Question

  • HI, I get this warning when I import a GDR2 project in VS2010. Why do I get this warning? And how can I get rid of it? I've seen options on the sqldeployment tab related to the nocheck (IngnoreWithNocheckOnForeignKeys) but checcking this option does not get rid of the warning in the error list window.

    Thanks,

    Christian

    Wednesday, June 30, 2010 6:27 PM

Answers

  • Hello Christian,

    This is because when it adds primary and foreign key constraint definitions to the project, it adds them with the WITH NOCHECK option.

    These can be removed from view by right-clicking on the DB project, selecting properties, click on the Build tab, and in the Supress Warnings add "03159;" (without the quotes).


    Edwer Fang [MSFT]
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
    • Marked as answer by ccoteMVP Thursday, July 01, 2010 6:47 PM
    Thursday, July 01, 2010 8:21 AM

All replies

  • Hello Christian,

    This is because when it adds primary and foreign key constraint definitions to the project, it adds them with the WITH NOCHECK option.

    These can be removed from view by right-clicking on the DB project, selecting properties, click on the Build tab, and in the Supress Warnings add "03159;" (without the quotes).


    Edwer Fang [MSFT]
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
    • Marked as answer by ccoteMVP Thursday, July 01, 2010 6:47 PM
    Thursday, July 01, 2010 8:21 AM
  • HI Edwer, thanks for the answer. But I am still wondering why it adds them with the WITH NOCHECK option. Is there a steeing I need to be aware of when I import new DB objects or upgrade projects? I find that using the suppress warning a bit crude to resolve this issue.

     

    Thanks,
    Christian

    Thursday, July 01, 2010 6:51 PM