PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET SqlBulkCopy

Reply

SqlBulkCopy

 
Thread Tools Rate Thread
Old 28-12-2006, 08:34 AM   #1
=?Utf-8?B?Sml0ZW5kcmEga3VtYXI=?=
Guest
 
Posts: n/a
Default SqlBulkCopy


what will happend if SqlBulkCopy violate constraints. and how i can solve
this problem.
  Reply With Quote
Old 28-12-2006, 06:56 PM   #2
William \(Bill\) Vaughn
Guest
 
Posts: n/a
Default Re: SqlBulkCopy

Generally, you don't BCP into PK/FK tables but into temporary tables (not
#temp) that are used as a buffer between the imported and live data. Once
the data is uploaded, run a SP that posts the data to the PK/FK related
tables using the data imported into the temporary tables. These will have
error routines to deal with the constraint issues.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

"Jitendra kumar" <Jitendra kumar@discussions.microsoft.com> wrote in message
news:9D14E12B-0002-4CF5-A179-D393BDDBE5C2@microsoft.com...
> what will happend if SqlBulkCopy violate constraints. and how i can solve
> this problem.



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off