Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 ignore foreign keys on an insert query

Author  Topic 

kory27
Starting Member

35 Posts

Posted - 2008-02-25 : 15:16:22
Hi. i am updating a field on a table i have called tblNavproductId. when doing the insert, i get the error message that you know, it is is violation of a foreign key constraint on NavId. i see the foreign key, so i know it is there and i understand that. i read the books online and here is the article;

http://msdn2.microsoft.com/en-us/library/ms186247.aspx

does anyone have a good example of this type of query? i am putting 990k+ records in at once, so would this be a bulk insert? Thanks.

pravin14u
Posting Yak Master

246 Posts

Posted - 2008-02-26 : 05:19:07
You can uSe BCP or Bulk Insert for any number of rows but I believe these should be used only for importing data from a extranal source like text file.

Where are you trying to insert your rows from?
Go to Top of Page

kory27
Starting Member

35 Posts

Posted - 2008-02-26 : 09:15:16
from a table within the db.i remove the foreign key constraint b/c the data is fine, but i think a couple of categories might not have been in the primary key table. its not ideal, but it really won't mess anything up.
Go to Top of Page

pravin14u
Posting Yak Master

246 Posts

Posted - 2008-02-27 : 00:35:23
http://www.microsoft.com/technet/abouttn/flash/tips/tips_122104.mspx

I hope the above one helps you. Let me know if you need more help.

Thanks
Go to Top of Page
   

- Advertisement -