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
 General SQL Server Forums
 New to SQL Server Programming
 Identity column as foreign key in bulk update

Author  Topic 

Vishakha
Starting Member

40 Posts

Posted - 2007-04-17 : 05:22:29
We need to import data from flat/xml files into our database.
we plan to do so in bulk as amount of data is huge, 2GB+
we need to do some validation checks in our code after that we create insert queries.

We have identity columns that are used as foreign keys in child tables. Question is how can I write a bulk/batch insert statement that will propogate the identity column to the child, as for all other we are creating the query in the application memory.
there are 2 parent tables and 1st table value needs to be referred to in 7 tables and second table's value in 6.


Thanks much for your help.

craig79
Starting Member

33 Posts

Posted - 2007-04-18 : 07:30:01

It depends upon how u r populating your Child Tables.

If u r using it through the DTS then u can Check the following option within the Package.
Enable Identity Insert.U will find this option present in the transform data task in the Options Tab.

Go to Top of Page
   

- Advertisement -