Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2005 > SQL Server 2005
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 22nd, 2006, 09:45 AM
Registered User
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Rollback in trigger??? (explicit/autocommit)

I’m using triggers for some more advanced integrity check. The problems is that the same trigger can be run from explicit transaction (this is when I start transaction from .NET) and as autocommit transaction ( very rare, only when we do some maintenance directly with SQL statements).

Currently if I want to rollback transaction from trigger I only issue RAISERROR statements, then .NET application catches this error and generates rollback. But the problem is if trigger is raised from some SQL statements outside .NET application (normally some maintenance work direct from SQL manager ) in that case error is generated but there is no rollback.

Is there any way to distinguish if transaction in trigger is explicit or autocommited, because for autocommited transaction I also need use ROLLBACK TRANSACTION?

I’m using SQL 2005!

Best regards


Old April 19th, 2008, 12:07 PM
Registered User
Join Date: Apr 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts


I am a new Oracle DB user, please help me understand if this is possible...

1) I have a connection.transaction in my VB.NET
2) My VB.NET issues an insert statement to a table
3) This table has trigger that issues many insert statements to different tables...

Will adding raiseerror in trigger be able to rollback all the insert statements including the one issued in VB.NET?

How about if VB.NET calls a stored procedure that uploads records, can raise error be used as well?

If anybody would be kind enough to send working samples (in case this is feasible), I would greatly appreciate it... Thanks!

Old April 20th, 2008, 05:28 PM
Friend of Wrox
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts

I don't think you'll get much help for Oracle on an SQL Server 2005 forum. Consider using an Oracle forum.

--Jeff Moden

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rollback of Delete gaurav_jain2403 SQL Server 2000 2 August 3rd, 2006 01:32 AM
ERROR: SET AUTOCOMMIT TO OFF is no longer support chemi Java Databases 0 December 28th, 2005 06:03 AM
SQL trigger, rollback , update, limits brucenx SQL Server 2000 1 December 17th, 2004 07:05 AM
IS ROLLBACK MANDATORY AFTER A TIMEOUT FAILURE ? antocaro SQL Server 2000 0 March 10th, 2004 04:33 PM
How do I Avoid a ROLLBACK when... wmhhodson SQL Server 2000 1 October 31st, 2003 01:07 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.