Hi,
I have a stored procedure with 2 CURSORS in it. They are back to back. The 1st one does an insert into a table. It then updates another table using the Identity which just inserted. This works fine.
The second CURSOR does not allow me to obtain the @@IDENITY.
for the 2nd update. This cursor is inserting into a table on another server. I use an XACT_ABORT ON to allow this.
The table inserts fine but the next update (to a the same table as I am updating above using another field), does not have the IDENTITY in it. I tried printing it in Query Analzyer and it doesn't display anything which matches what is happening. In QA is does indeed show the records being updated. It has the proper record count, but like I said, since the @@Identity is blank or null, it updates my field to nothing.
Ideas anyone?
Thanks,
Remember when... everything worked and there was a reason for it?
I have a stored procedure with 2 CURSORS in it. They are back to back. The 1st one does an insert into a table. It then updates another table using the Identity which just inserted. This works fine.
The second CURSOR does not allow me to obtain the @@IDENITY.
for the 2nd update. This cursor is inserting into a table on another server. I use an XACT_ABORT ON to allow this.
The table inserts fine but the next update (to a the same table as I am updating above using another field), does not have the IDENTITY in it. I tried printing it in Query Analzyer and it doesn't display anything which matches what is happening. In QA is does indeed show the records being updated. It has the proper record count, but like I said, since the @@Identity is blank or null, it updates my field to nothing.
Ideas anyone?
Thanks,
Remember when... everything worked and there was a reason for it?