copy an identity column into another table
- by slake
I have 2 tables that are related,both have identity columns for primary keys and i am using a vb form to insert data into them,My problem is that i cannot get the child table to get the primary key of the parent table and use this as its foreign key in my database.
the data is inserted fine though no foreign key constraint is made.I am wondering if a trigger will do it and if so how. All my inserting of data is done in vb.
The user wont insert any keys. all these are identity columns that are auto generated. If a trigger is my way out please illustrate with an example.
If there is another way i can do this in VB itself then please advise and an example will be greatly appreciated
Thanks in advance