|
Subject:
|
Rollback in trigger??? (explicit/autocommit)
|
|
Posted By:
|
edvin
|
Post Date:
|
6/22/2006 9:45:51 AM
|
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
edvin
|
|
Reply By:
|
MK747
|
Reply Date:
|
4/19/2008 12:07:56 PM
|
Hi,
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!
|
|
Reply By:
|
Jeff Moden
|
Reply Date:
|
4/20/2008 5:28:24 PM
|
I don't think you'll get much help for Oracle on an SQL Server 2005 forum. Consider using an Oracle forum.
--Jeff Moden
|