Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MIIS Export to Database Tables With Identity PKs that are also FKs

0 views
Skip to first unread message

chchin2

unread,
Jan 27, 2009, 3:41:01 PM1/27/09
to
Hi folks, I am attempting to export metaverse data to a Sql2K5 database. The
issues is that the target database table uses an identity primary key. What
ends up happening is that I will have two entities to export and they are
related. I export entity A to a table in the target database which uses an
identity PK so the PK is assigned only then, upon insert. Now I have to
export entity B to a table that has a FK reference to the new rows inserted
in table A. Since I do not know ahead of time, what those new table A PKs are
going to be, I ofcourse receive a constraint violation, that the new rows I
am inserting to B do not mention valid FK from table A's set of PKs. Any
ideas?

StevieJ

unread,
Apr 20, 2009, 10:55:03 AM4/20/09
to
We have a similar setup and solved the problem by inlcuding the PK field in
the MV and adding an import attribute flow for that key into the MA for
enitity A and running a 3 stage export run profile for entity A: Export >
Import > Sync.
You can then add the PK field to the export flow for entity B and you won't
recive the PK violoations as long as you always run the export for A first.

Hope that helps.

lebo

unread,
May 8, 2009, 11:29:14 AM5/8/09
to
Another helpful methodology is to deploy an insert trigger on Table A
such that Table B gets an insert, with the FK,
whenever Table A gets an insert from MIIS.

Depending on what data is available when the Table A insert is made
and what data Table B requires for a new record
to be created, this can be the simplest means.

0 new messages