--------------- SQL Server 2000
Begin Transaction
------- Paste your code here
------- On every Insert or Update write
if @@Error > 0
GoTo ErrorPoint
Commit Transaction
ErrorPoint: --- this is go to defination
Rollback Transaction
--------------- SQL Server 2005
Begin Try
Begin Transaction
----------- Paste your code here
Commit Transaction
End Try
Begin Catch
Rollback Transaction
End Catch
Begin Transaction
------- Paste your code here
------- On every Insert or Update write
if @@Error > 0
GoTo ErrorPoint
Commit Transaction
ErrorPoint: --- this is go to defination
Rollback Transaction
--------------- SQL Server 2005
Begin Try
Begin Transaction
----------- Paste your code here
Commit Transaction
End Try
Begin Catch
Rollback Transaction
End Catch
1 comment:
This is now need of every common developer.
Post a Comment