I am facing a problem while doing the rollback in sql server 2000 using VB.Net.
By using the conventional Method::
Dim transaction as SqlTransaction
transaction = Con.BeginTransaction
</ sample code/>
and getting error
But the above method is not working in my code.
I tried the code written below but is not able to implement in stored procedure.
insert into delete_demo values(7,'Aar3')
insert into delete_demo values(2,'Aakr')
Any help is most welcomed....
ROLLBACK IN A STORED PROCEDURE
Page 1 of 1
How can i successfully execute rollback in a stored procedure in Sql S
1 Replies - 2593 Views - Last Post: 29 November 2008 - 06:28 AM
Replies To: ROLLBACK IN A STORED PROCEDURE
Re: ROLLBACK IN A STORED PROCEDURE
Posted 29 November 2008 - 06:28 AM
A typical SQL Server Transaction statement should be as below..
Begin transaction MyTrans /* Your code here */ if (@@error <> 0) begin print 'Modification failed!' goto on_transaction_failed end Commit Transaction MyTrans print 'The execution completed successfully' goto on_complete on_transaction_failed: begin rollback transaction trans print 'Rolled back successfully' goto on_complete end on_complete:
Page 1 of 1