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 |
|
imranabdulaziz
Yak Posting Veteran
83 Posts |
Posted - 2008-06-17 : 09:32:32
|
| Dear all,i am using sql server 2005.i have three insert and update statement i want to execute it either entirly or rollback everything.my question is in this scenario Is i have to write negin tran for every insert or update stmt or IS there any way so that even single tran works for all there insert or update statementThank you. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-06-17 : 09:34:59
|
| Begin TransInsert...Update...Insert.......Commit transMadhivananFailing to plan is Planning to fail |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-06-17 : 09:35:25
|
Something similar toBEGIN TRY BEGIN TRANSACTION INSERT... UPDATE... INSERT... DELETE... COMMIT TRANSACTIONEND TRYBEGIN CATCH ROLLBACK TRANSACTIONEND CATCH E 12°55'05.25"N 56°04'39.16" |
 |
|
|
|
|
|