Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Foriegn_key constraint (help needed urgently)

Foriegn_key constraint (help needed urgently)

Scheduled Pinned Locked Moved Database
helpdatabasequestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Learner520
    wrote on last edited by
    #1

    Hi everybody, I'm getting this error. The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Contract_ContractType". The conflict occurred in database "ContractDB", table "dbo.ContractType", column 'ContractTypeId'. The statement has been terminated. I understand that this is because I'm not sending the exact ContracatTypeId to table. I'm doing this deliberately because I want to store Null as well for some reason. Please could any body tell me how can I remove/drop this constraint from database (please bare in mind I have no table diagram). any help will be much appreciated.

    I 1 Reply Last reply
    0
    • L Learner520

      Hi everybody, I'm getting this error. The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Contract_ContractType". The conflict occurred in database "ContractDB", table "dbo.ContractType", column 'ContractTypeId'. The statement has been terminated. I understand that this is because I'm not sending the exact ContracatTypeId to table. I'm doing this deliberately because I want to store Null as well for some reason. Please could any body tell me how can I remove/drop this constraint from database (please bare in mind I have no table diagram). any help will be much appreciated.

      I Offline
      I Offline
      i i i
      wrote on last edited by
      #2

      just goto your detail table where your Foreign Key exists , open the table and click on your field which is Foreign Key and right click and click on Relationships , select the specific relationship and on the right side Grid in table designer Set the value for 'Enforce Foregin Key Constraint' to 'No'

      Best Of Regards, SOFTDEV If you have knowledge, let others light their candles at it

      L 1 Reply Last reply
      0
      • I i i i

        just goto your detail table where your Foreign Key exists , open the table and click on your field which is Foreign Key and right click and click on Relationships , select the specific relationship and on the right side Grid in table designer Set the value for 'Enforce Foregin Key Constraint' to 'No'

        Best Of Regards, SOFTDEV If you have knowledge, let others light their candles at it

        L Offline
        L Offline
        Learner520
        wrote on last edited by
        #3

        thanks a lot

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups