Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am facing issue with tables in sql server databases. its not allowing to copy records or insert new record from software.

Previously when I disable trigger, it was then allowing to do so, but now that also not have any effect. Its seems problems are increasing day by day.

When trying to copy records to new table or trying to drop a table, it gives below error.
Msg 3609, Level 16, State 2, Line 1 The transaction ended in the trigger. The batch has been aborted.


Enabling trigger creates issues, if its made disable, then works fine.

PLEASE HELP.
Posted
Updated 30-Mar-15 19:53pm
v4
Comments
Kornfeld Eliyahu Peter 30-Mar-15 4:47am    
What trigger?
jawad59 30-Mar-15 7:50am    
trigger may be associated with that table.

1 solution

As error says there are triggers associated with this table. If you want to drop any table you need to drop all the related constraints first.
 
Share this answer
 
Comments
jawad59 30-Mar-15 6:41am    
I dont want to drop table. I just want it to insert records and copy data to another table. Please help
Code For You 30-Mar-15 7:30am    
please share the code of trigger
jawad59 30-Mar-15 7:42am    
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [safety]
ON DATABASE
FOR DROP_TABLE, ALTER_TABLE, CREATE_TABLE,Drop_trigger
AS
PRINT 'you must check the permission of this table'
ROLLBACK;
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ENABLE TRIGGER [safety] ON DATABASE



Now sql is also giving same error when i try to create new database.
jawad59 30-Mar-15 7:49am    
error when creating database

TITLE: Microsoft SQL Server Management Studio Express
------------------------------

Create failed for Database 'gwb18mar2015'. (Microsoft.SqlServer.Express.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+Database&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)

------------------------------

The transaction ended in the trigger. The batch has been aborted.
you must check the permission of this Database (Microsoft SQL Server, Error: 3609)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=3609&LinkId=20476

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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