Tuesday, 15 January 2013

.net - SQL Bulkcopy for Client / Parent relationship -


We have two datatables, which are client with one million client rows / SQL data databases via SQL BulkCopy Should be put in. It is possible that many examples of this NAT application are running in parallel to insert different data into the same tables.

We have an identity column in the parent table for the auto-generation of the primary key.

The problem is that we do not include the related foreign key in the child's table.

Does anyone know how to use wholesale copies in 1: N relationship problem? We can not create an ID in NDS because many examples can run.

Thank you Daniel

"post-text" itemprop = "text">

This is just one of the many reasons that I have identified for all my primary keys I like using natural keys.

How do you know which children have to go to the parents in the data source? If they are attached to any column there, then it should not be very difficult to incorporate parental rows, insert the rows of children in a loft table, then identify the ID with that column's parent Insert rows of children while joining.

If the relationship is related to the status file in the bus or something like this and then it becomes more difficult, you can either include the file line # and then use the same steps as above. , Those (child.line_num> parent.line_num and any other parent.line_num are not included between those two numbers) or you can import parent once at a time, capture a loop, then that Use the ID to summon all your children Do Ilit. You can set it up in SSIS without much trouble, but it can be slow.

With more details on your problem (data source, etc.), I may be able to provide more features.


No comments:

Post a Comment