I'm not sure what is going on here - if my brain has gone on Christmas holiday early or what, but I'm having issues with an apparently simple task.When data is deleted from a table I want to log it (for specific criteria only) into a table which can then be examined in case of issues at a later date. Nothing new here - so I thought a delete trigger would be in order.

There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan I would never join a club that would allow me as a member - Groucho Marx

are you only capturing queries that match a certain task type?it looks to me like that would be the point of failure to me; the ID looks like it's a copy paste from another query that should not be part of the trigger, maybe?

Lowell--There is no spoon, and there's no default ORDER BY in sql server either.Actually, Common Sense is so rare, it should be considered a Superpower. --my son

Lowell (12/12/2012)Stuart what is the relevance of this WHERE statement coming from?

WHERE ttask.id = 23

are you only capturing queries that match a certain task type?

Correct - at the moment we have several process that update the system in question either via SQL jobs, the database application or 3rd party software. When this specific task type is affected it has the potential to screw the system for the user. So what I'm trying to do is at least find out what is doing it before I can explain to someone the errors of their ways

There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan I would never join a club that would allow me as a member - Groucho Marx

There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan I would never join a club that would allow me as a member - Groucho Marx

There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan I would never join a club that would allow me as a member - Groucho Marx

In that case, I'd need table definitions, sample data (insert statements, please), and the full create script for the trigger.

Once I can reproduce the error, it should be simple the solve.

Without that, I'm left guessing a bit. Possibly the join is on the wrong columns. That would be my next guess, based on the column names. But guessing something, then guessing something else, till we get it, is where we're at right now, till we can reproduce the issue.

There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan I would never join a club that would allow me as a member - Groucho Marx