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 2008 Forums
 SSIS and Import/Export (2008)
 ssis dataflow xml source to 2 tables identity col

Author  Topic 

Nader
Starting Member

41 Posts

Posted - 2010-04-30 : 16:59:26
import from xml to two table with foreign key pointing to identity primary key problemQuestion:
I have two tables user (id, name,etc.) and userassociation(userid, orgid, etc.)
User(id) is a primary key with identity set to yes
userassociation (userid) is foreign key referencing user(id)

I have several small xml files each has information about a single user and userassociation.

I am using dataflow task and xml source to import the populate the two tables
How can I retrieve the identity after importing a row to the user table to use it to add a row to the userassociation

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-05-01 : 04:45:04
see the below

http://visakhm.blogspot.com/2010/04/using-xml-to-batch-load-master-child.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Nader
Starting Member

41 Posts

Posted - 2010-05-04 : 21:14:40
Thanks
Go to Top of Page
   

- Advertisement -