Click here to Skip to main content
15,908,445 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am deleting data from one table using trigger but getting error like in below

Line 129
The current transaction cannot be committed and cannot support
operations that write to the log file. Roll back the transaction.
The statement has been terminated.


Please help me why i am getting this error.
Posted
Comments
Sahan2u 18-Jan-16 2:04am    
Do you have a TRY/CATCH block ?
Member 11337367 18-Jan-16 2:05am    
s.we have.

1 solution

You always need to check for XACT_STATE(), irrelevant of the XACT_ABORT setting.

Refer the following link which has a good answer for this.

sql server - SQL Transaction Error: The current transaction cannot be committed and cannot support operations that write to the log file - Stack Overflow[^]
 
Share this answer
 
Comments
Member 11337367 18-Jan-16 2:26am    
directly i can use in trigger?
Sahan2u 18-Jan-16 2:39am    
Yes you can.
Member 11337367 18-Jan-16 2:46am    
what is the use of having that command in sp?
Sahan2u 18-Jan-16 3:53am    
Read the answers given to that question. For more information you can also read the answers here.

http://stackoverflow.com/questions/15980318/trigger-error-the-current-transaction-cannot-be-committed-and-cannot-support-op

it has bit more description.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900