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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-02-23 : 09:06:38
|
| Alex Donald writes "Hi,My question is how to structure correctly Transaction execution when INSERT/UPDATE is performed within Cursor loop orthrough nested stored proceduresCurrently I check for @@error before each FETCH NEXT FROM, if true ROLLBACK TRAN and CLOSE/DEALLOCATE CursorThanks" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-02-23 : 09:41:02
|
| 1 For insert and Update you can use Set based ApproachesInsertInsert into table2(columns) Select columns from table1UpdateUpdate T1 set col=T2.colfrom Table1 T1 inner join Table2 T2on T1.keycol=T2.keycol2For error handling refer thishttp://www.sommarskog.se/error-handling-I.htmlMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|