RollBack in SQL Server

Results 1 to 2 of 2

Thread: RollBack in SQL Server

  1. #1
    Join Date
    Dec 1969

    Default RollBack in SQL Server

    Hi There,<BR><BR>I am facing problems in rollback in sql server.<BR>Suppose I have a ASP Page with few Insert statements. And if any of the insert is failing i want to rollback all insert results which are executed before within that ASP page. <BR><BR>What should be the syntext for that and where should i set those?<BR><BR>Thanx in advance,<BR>Ani.

  2. #2
    Join Date
    Dec 1969

    Default RE: RollBack in SQL Server

    write the code as follows..<BR>connection.begintrans<BR>execute your sql statements..<BR> if (SQL statements contains errors)<BR> connection.RollbackTrans<BR> else<BR> connection.CommitTrans<BR>connection.close<BR><BR> <BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts