View Full Version : Stored procedure help

04-30-2009, 07:30 PM
I need help with a stored procedure I am writing.

If a certain condition exists, I need to perform inserts to two separate databases.

First, I insert a new record into database A, using three variables whose values are retrieved from an XSLT transformation that is done. However, there is a fourth column in each record in Database A called "ID". This field is automatically generated with a unique identifier (int) each time a new record is created.

My second insert, into Database B, needs to include the unique identifier that was just created for the record in question in Database A. Since I don't know what that value is, I need to find a way to select it from Database A.

Any help here would be great.... Thanks!

05-02-2009, 03:40 AM
Can you give an example of your current code?

Old Pedant
05-02-2009, 05:31 AM
Is this what you are looking for??

If this ID column with the unique identifier that you referred to is *NOT* an AUTOINCREMENT column, then show us the DB schema for it and how you generate the values for it.