Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INSERT statement conflicted with COLUMN FOREIGN KEY

Status
Not open for further replies.

ProgrammingB52

Technical User
May 7, 2003
37
0
0
US
I am trying to insert values in a table where there is a foreign key to another table. I can't insert data into either of these tables and get the same errror....
INSERT statement conflicted with COLUMN FOREIGN KEY SAME TABLE constraint 'FK_OrgUnit_OrgUnit'. The conflict occurred in database 'Asset', table 'OrgUnit', column 'OrgUnitId'.
The statement has been terminated.
How do I insert data into these 2 tables with the foreign key constraint?
 
The FK requires that the data exists in the othr table first so u got to insert there first and then on table 'OrgUnit'.

AL Almeida
NT/DB Admin
"May all those that come behind us, find us faithfull"
 
What happened was the table had a foreign key to itself so I deleted it and it worked. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top