I have three tables.
Table One is a master table which contains rows which need to be updated with data from the other two tables (I'll call them Table Two and Table Three).
I have created a cursor which updates existing rows in Table One with data from Table Two. This works fine, and following the successful execution of the cursor, Table One contains the new data.
However, I have a second cursor, which updates the same columns in Table One as the first cursor does, (but never the same rows), and when this second cursor is executed, the data in Table One is updated with the data from Table Three. However, when querying Table One after the execution of the second cursor the data from Table Two is no longer present.
Each cursor is executed in its own transaction, which is committed after the cursor has been closed and deallocated.
This is my first attempt at using cursors, and I need to know whether what I'm doing is technically possible, and if so what may be causing the updates from the first cursor to be lost.
Any help would be greatly appreciated!
Thanks R.W.
Software/Hardware used:
SQL Server 2005
ASKED:
March 23, 2011 10:57 AM
UPDATED:
March 23, 2011 5:26 PM