August 30, 2010 at 4:19 am
I am using a trigger to audit use of a database. This is an after update trigger that checks to see if the date lastmodified column in a table is equal to the same column in a view, when I run it in my trigger the condition is always faults - if I run the same query manually I get the correct outcome. Any ideas why I am seeing this issue?
August 30, 2010 at 5:29 am
JblakTSql (8/30/2010)
I am using a trigger to audit use of a database. This is an after update trigger that checks to see if the date lastmodified column in a table is equal to the same column in a view, when I run it in my trigger the condition is always faults - if I run the same query manually I get the correct outcome. Any ideas why I am seeing this issue?
hard to say without more detials; a view is just a saved SQL statement, run on demand, does the view point to the exact same table that the trigger is on? are you trying to get the lastmodified that occurred before the trigger fired(you need to use DELETED.lastmodified instead);
show us the trigger code and what it was supposed to do, i'm sure we can help you sort out the issue.
Lowell
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply