Making a Procedure Log who called it

Viewed 55

Similar to this question Is it possible to find out who called a stored procedure in SQL Server 2005. The difference is that I need to be able to add something to a query to be able to log what (the anthropomorphic who) calls it and log that information. This needs to be done on an operating system of DBs. There are destructive methods for doing (like changing permissions and finding out who yells or what fails) but I need to be less draconian. I want to create a simple log that will collect information over a period of weeks. A sample would look like

  Calling Proc  Called Proc   When
 -------------------------------------------------   
  Proc1         Proc2         2020-08-15 3:45:15
  ProcA         Proc2         2020-08-15 3:57:10

There is lots of information I can get but I have yet to find something that will tell me real time. I am guessing I am missing something right in front of me but for the life of me I can't see it. Any help is appreciated.

0 Answers
Related