After update trigger does not fire

SQL Server 2000
VB.NET 2003

I have an after update trigger in one of my table. it works fine when EXECuting a stored proc from Query Analyzer that updates the table.  The prob is that the trigger does not fire when running the SP from my VB.net code using SqlComm.ExecuteNonQuery.

Any idea how to fire the trigger when running my SP from vb.NET?

Thank you.
LVL 14
cezarFAsked:
Who is Participating?
 
Jai SConnect With a Mentor Tech ArchCommented:
the firing of trigger depends on SQL ...and this has really nothing to do with your FRONT END...
just check one thing...see whether the DATA really gets updated to your table first...if it updates then your trigger has to fire...unless there are some operations that makes the trigger to fail ( like inserting NULL values to non nullable columns)
0
 
cezarFAuthor Commented:
thanks!

in both scenario the data is being updated. it's just that the trigger does not fire when the sp is executed from vb.net.
0
 
Jai STech ArchCommented:
can you tell us what is there in the trigger...
just a note on checking

create a dummy table...with one column
insert a record ion your trigger to this dummy table and check after your UPDATE...if there are records in this table then your trigger fires and the problem is with you other content in the trigger...
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
cezarFAuthor Commented:
the trigger is a bit complecated. the only thing I noticed is that it takes about 30 secs when I exec the sp in query analyzer but a lot faster when called in vb.net. seems to me that the trigger is not being fired at all.  
0
 
Jai STech ArchCommented:
there it goes...may be it just TIMES OUT...try increasing your CONNECTION TIMEOUT in your SERVER
database --right click -- properties -- connection timeout
0
 
cezarFAuthor Commented:
contemplating to just convert the trigger to an SP. been trying to solve this the whole day. another strange thing is a similar FOR INSERT trigger is working.  
0
 
cezarFAuthor Commented:
i'm setting the time-out to 120 in my vb.net code. besides, if i hit a time-out error, i should get an error message and the table should not be updated.
0
 
Jai STech ArchCommented:
incase of a trigger you wont get an error...becos its a disconnected process from your UPDATE from VB.NEt...
you probably need to handle that error in your SQL - TRIGGER using the error objects that SQL 2005 provides...
0
 
assystConnect With a Mentor Commented:
Try doing something simple in the trigger like updating a column and check whether the trigger is getting fired. If that works then try with your trigger logic.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.