well, if a given id exists more than once in your tbl_directdebits, it will insert multiple rows.
...from tbl_directdebits where id= @id
does this query return any rows?
SELECT id, count(id)
FROM tbl_directdebits
GROUP BY id
HAVING count(id) > 1
based on that command delete from tbl_directdebits where duplicateof=@id id say that whatever logic you have in palce that updates/populates the column duplicateof is broken or failing, if that is how you test for whether an id exists or not.
Lowell