How does this happen? the tblLinks doesn't even have a column called websiteID. websiteID is the primary key of the table tblwebsite. LinkID is the primary key of tblLinks. There is not LinkID column in tblwebsite.
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_tblLinks_tblWebSite". The conflict occurred in database "Linkexchanger", table "dbo.tblWebSite", column 'WebSiteID'. The statement has been terminated.
So how does this happen? How do I terminate the foreign key relationship? I understand I can add this to my Insert stored procedure:
ALTER TABLE Links
DROP CONSTRAINT FK_tblLinks_tblWebSite
but that stored procedure is used for other functions in my website, and I don't know if doing that is a good idea. Is there a way to relax the constraints for the purpose of this function here? I'm taking data from a backup links table and trying to write a new row in the links table.
View Complete Post