Lookin for a function that gives me the name of the process modifyng a table

  • HI guys, i have been googling and i dont know if exists or my serach keywords are wrong.

    But, is there a function that gives me the name of a procedure, trigger, process in general that is modifyng a table?

    Like if,suppose i have Table A , then i run the procedure zSP_UPDATE_TABLE_A, when a update ocurss in TableA then i get the name of the process that made the update .

    just like the function db_name() but that gives me the name of the process that made the update.

    Any help would be aprecciated.

  • If you are inside a stored procedure, function or trigger

    object_name(@@procid)

    ____________________________________________________

    Deja View - The strange feeling that somewhere, sometime you've optimised this query before

    How to get the best help on a forum

    http://www.sqlservercentral.com/articles/Best+Practices/61537
  • Thanks for the fast answer, the function worked and it gives me the name of the process.

    i was trying to get the name of the process modifying the table, but guess i need to add the

    object_name(@@procid) to all the processes that move something in the target table.

    i cant modify some of those, so i cant use this option.

    For a new question.

    ¿Is there a way to create or see (if exists) a log or something that tells me wich processes have modified certain field on a table or just the table?

  • OK for anyone that enters thhis topic, i entered this link:

    http://sqlserver2000.databases.aspfaq.com/how-do-i-audit-changes-to-sql-server-data.html

    and used some recommendations from there.

    im still missing the proceess that changes the data, but i got some useful info on the link below, hope it helps to anyone who enters this topic with a similar problem.

    cheers =D

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply