|
Posted by Erland Sommarskog on 06/27/07 21:28
Weyus (weyus@att.net) writes:
> Because I have two tables, A and B, both of which I need to bulk load.
> B has a foreign key to A. A has constraints on it. B has no
> constraints.
> So I have two files, one for loading A and one for loading B.
>
> If I bulk load A and some of the constraints kick out records, such
> that not all of the records load, then when I load B, I will not have
> a way to know how to set the foreign key in B correctly.
>
> If I was just loading one table, your point would be totally valid.
I can't escape to note that this would be a lot simpler if you did
not use IDENTITY at all.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|