Log which stored procedure issued a delete statement

sybase

We have an issue where rows are deleted from a table and we can't figure out where this is happening. We have a trigger on the table to move the rows to another table, so that we can move the data back to the original table.

There are 20 to 30 stored procedures that delete rows from the table, so I was wondering if there was some way for the delete trigger to know what procedure invoked it.

We're using Sybase 15.

Thanks!

Best Answer

You need to add this implementation in your code base . I donot know If there is any other way in which Sybase itself keeps the track of it .

You can add a column in your table which can keep some identifier to the specific stored procedures and keep the track of the same in your trigger