Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
tuka
Starting Member
26 Posts |
Posted - 2006-06-27 : 07:17:51
|
| Hi,Is it possible to run a long running transaction in this fashion using say stored procedures:1) In transaction mode update a row in a table 2) return a reference(s) to the affected row(s) (which will remain locked but still readable) eg. row Id 3) after a while, run another stored procedure that commits or rolls back the stored procedure in (1).I would be using the reference in a .NET application as it will be passed around object during the long running process Is the above possible. I have only seen example of trasactions run all in the same sp but was wondering if it sould run in differents spsTIA,Tuka |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-06-27 : 09:11:11
|
| A transaction is held on the connection.The transaction level has to be the same on exit from an sp as on entry.Given that you can start a transaction call an sp to update a row which will lock it (and maybe more) then read the updated row.Whatever began the transaction will have to commit it.I would review what you are trying to do and maybe think of a different way though - I suspect you are heading for problems.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|