.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Trigger not firing but data is changed...

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :

We are still in SQL 2005 and I am wondering if there is EVER a possibility that data might change and the related trigger would not fire??  We have fields that are changing seemingly randomly.  We have put triggers on the tables to catch the changes.  We have all the valid changes captured by the trigger, but the improper change is not captured and we have NO idea where the record change is coming from.  Any thoughts??

Thanks in advance,


View Complete Post

More Related Resource Links

ASP.NET Events and Pageload not firing when Datagrid containing large number of rows of data

Hi All, I have a datagrid in aspx page.Inside of datagrid i am using around 15 controls such as Button,dropdownlist and text box controls.Once the datagrid binds then the events in the aspx page not firing.Issue occured when the number of rowsgreater than 500.The number of rows less then its works fine.If anybody knows the solution please let me know."Platform i am working on ASP.NET1.1"Regards Hareesh

Activity to handle SQL Trigger firing

Hello, Does anyone have a recommended best practice for how a workflow should "watch for" the event of a SQL (2005) trigger's firing -- rather like the FileWatcher sample?  Or better, perhaps a code sample? Thanks in advance for your thoughts. John

how to stop refresing data grid when selection changed

Hi , I have datagrid on my page bounded with linq datasource. I want to stop refresing datagrid when I need to show details of selected row. Could you please help me to do that. Regards Reside 

Trigger not firing on second table.

Im wondering if someone can help me. I have created 3 simple tables. The 1st table has a trigger that inserts a record into the 2nd table. The second table has a trigger that inserts into the 3rd table. When I insert a row into the 1st table the 1st trigger on this table fires but the trigger on the 2nd table does not fire.  In the triggers i have two print statements which should print out text when the trigger is firing but I never see the 2nd trigger firing. Stepping through with the debugger in SQL 2008 I am also not able to F11 into the 2nd insert statement. Im left scratching my head on this and was wondering if anyone could help here. Thanks in advance. I have included a sampel script to replicate the porblem.     CREATE TABLE [dbo].[TriggerTest1](     [Id] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,     [Value1] [int] NULL,     [Value2] [int] NULL,  CONSTRAINT [PK_TriggerTest1] PRIMARY KEY CLUSTERED (     [Id] ASC )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY] ) ON [PRIMARY] CREATE TABLE [dbo].[TriggerTest2](     [Id] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,     [Value1] [int] NULL,     [Value2] [int] NULL,  CONSTRA

Preventing selectedindex changed from firing on binding

When I bind a combo box to an object and it is initially displayed, I notice that the selectedindex changed event is being fired. I don't want this event to fire unless the control is changed interactively. Is there a way to prevent this from occurring or should I be using a different event? TIA

In a trigger can up insert data into a table located on a linked server?


EXEC master.dbo.sp_addlinkedserver @server = N'ServerB', @srvproduct=N'SQL Server'
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'ServerB',@useself=N'False',@locallogin=NULL,@rmtuser=N'lnklogin',@rmtpassword='########'
EXEC master.dbo.sp_serveroption @server=N'ServerB', @optname=N'collation compatible', @optvalue=N'false'
EXEC master.dbo.sp_serveroption @server=N'ServerB', @optname=N'data access', @optvalue=N'true'
EXEC master.dbo.sp_serveroption @server=N'ServerB', @optname=N'dist', @optvalue=N'false'
EXEC master.dbo.sp_serveroption @server=N'ServerB', @optname=N'pub', @optvalue=N'false'
EXEC master.dbo.sp_serveroption @server=N'ServerB', @optname=N'rpc', @optvalue=N'false'
EXEC master.dbo.sp_serveroption @server=N'ServerB', @optname=N'rpc out', @optvalue=N'false'
EXEC master.dbo.sp_serveroption @server=N'ServerB', @optname=N'sub', @optvalue=N'false'
EXEC master.dbo.sp_serveroption @server=N'ServerB', @optname=N'connect timeout', @optvalue=N'0'
EXEC master.dbo.sp_serveroption @server=N'ServerB', @optname=N'collation name', @optvalue=null
EXEC master.dbo.sp_serveroption @server=N'ServerB', @optname=N'lazy schema validation', @optvalue=N'false'
EXEC master.dbo.sp_serveroption @server=N'ServerB', @optname=N'query timeout', @optvalue=N'0'

How to judge changed data and update data in database


For my case, I use linq to sql to select data from database.

I want to do the edit fuction which has 3 steps.

1. load all the data first

2. enter the button then save changed content not all to database.

I am totally new to asp.net. Could someone tell me that how to save only changed data using linq?


Thank you






Selection Changed event is not firing for listview



     In my listview i have two columns, once is check box and another one is normal column. if i select in normal column, listview's selection changed event is fring, but when i select check box(This checkbox is inside the datatemplate) listview's selection changed event is not firing. Can any one tell me how i can achieve it. If you are not understand, please give your email id, i will send my sample application to you.



Udayakumar S

Grid's PreviewMouseRightButtonUp event handler not firing until I changed something...don't unders


So to keep this brief, my heirarchy is: Window ->Canvas ->Listbox -> Grid (part of template for listbox) -> etc.


I wanted a draggable selection box so I did the fairly standard thing of rendering a square to the screen by using a drawing visual within a host class and then adding that drawing visual to the tree with the main helper methods. The PreviewMouseRightButtonUp event handler however, of my grid, was never being fired unless I just clicked without dragging. In other words, if I dragged on my grid to create my selection square, the PreviewMouseRightButtonUp event handler of the grid is never being fired. So, instead I associated this eventhandler with the PreviewMouseRightButtonUp event of my Visual host (which contains my square drawing visual) and the event fires.

Pretty much, the PreviewMouseRightButtonUp event never bubbles down the grid for some reason after I my drawing is rendered to the screen. Can anyone answer why or do you need to see source code?

Auto udating data in multiple table through trigger.


table a(

sno IDENTITY int(1),

name varchar(5),

roll_no numeric(5)

sum more columns


table b(

sno IDENTITY int(1),

name varchar(5),

sum more columns


table c(

sno IDENTITY int(1),

roll_no numeric(5)



Could any one kindly tell me how can i do it.

whenever data is entered in table a the values of name and roll_no to be automatically filled in table b and table c with use of trigger.

trigger on insert is failing for data insert in a table


hello experts,

here is some question for you and i'm sure you guys will have awsome solution

i have a table with companyid and tranid as a primary key. there is a insert trigger on it and the trigger insert property is instead of insert, means data is manually inserted thru trigger.

in trigger, i check if companyid and tran id exists in the table or not, if yes then i add a record in another table (history table/duplicate table) and if not found then i add record in this table.

this stuff work perfectly if i work in ssms and it is all good but when i work thru ssis, it gives me following error and it clearly showing that it is because of pk

[Insert Data in EFT [46]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80004005  Description: "The statement has been terminated.".
An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80004005  Description: "Violation of PRIMARY KEY constraint 'PK_Mail_Queue'. Cannot insert duplicate key in object 'dbo.EMail_Queue'.".

any solution

mark it as answer if it answered your question :)

The number of calls to the Changed event for a single update in the data exceeded the maximum limit.


Dear All,

We have hit the big limit of 16 change events per single update.  Is there any way to extend this to say 25, we are not using infinate loops or anything.

Alternatively, is it possible to disable some change events when values are updated?


William Man

Data from the server subscription cannot trigger table trigger


Publisher  Server A  (Job  table) no trigger

Subscription Server B (Job table) has trigger

Data from the Server A subscription cannot trigger Server B Job table trigger

Problem with decryption data in stored procedure if local date on my machine was changed


Hi people!

Can anybody help me with my problem?

I have one machine (Server 2003 x64 SP2, SQL Server Standard Edition (64-bit) version 9.00.4053.00). Also I have a stored procedure in database that doing a validation of users, and contains the next code:

OPEN SYMMETRIC KEY PasswordFieldSymmetricKey
  CONVERT(varchar, DecryptByKey(EncryptedPassword)) AS 'Password'
  FROM [User]
  WHERE ([Login] = @Login)
        AND (CONVERT(varchar, DecryptByKey(EncryptedPassword)) = @Password);
CLOSE SYMMETRIC KEY PasswordFieldSymmetricKey;

All works correctly but if i change the "Date and Time Properties" on my machine i receive the next error

(0 row(s) affected)
Msg 15315, Level 16, State 1, Procedure user_login, Line 111
The key 'PasswordFieldSymmetricKey' is not open. Please open the key before using it.

If i set the current date it will work correctly again.
One strange thing:
if execute the query "SELECT * FROM sys.symmetric_keys" i have the next date of creation for my symmetric keys

2010-11-04 11:18:49.300

And if i set a date less then date of

radio button checked changed event not firing with onclick javascript function



I have used below code.

<asp:RadioButton GroupName="grpAssoc" ID="rbtEvery" runat="server" Text="Everyone"
                                                                                    onclick="return doChangeAssociationType(0);" AutoPostBack="True" oncheckedchanged="rbtEvery_CheckedChanged"

but oncheckedchanged="rbtEvery_CheckedChan

Retrieving changed/updated data from all tables in database



I'm looking for some advise on how I could solve the problem I face, I have various instances of sqlexpress 2005 in different remote locations which are not accessible via internet vpn etc as they are all in corporate networks that will not allow access. What I think I need to do is create some sort of process/service that can be installed on the client and run at a set time/date that collects all the data from theses instances and then push the changes to our remote instance of sql server. Can anyone possibly point me in the right direction of various technologies I should be looking into to solve this problem. All clients would be running windows XP. I have been searching for a few day's but I can't find anything to get me going. If this is not the right forum for this type of question can you suggest any?


Thank you.

Binding WPF Controls to an Entity Data Model

In this interview, programming writer, McLean Schofield, demonstrates how to bind WPF controls to an entity data model, using Visual Studio 2010 Beta 1. You can also learn more in the topic: Walkthrough: Binding WPF Controls to an Entity Data Model.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend