Getting the statement being executed by sp_executesql

  • Hi all

    i'm having some problems, i have a trigger on a sensitive table, therefore i need to log every change made to it, by anybody who access it, but the problem is that the support department uses Enterprise Manager access the data in the table, and when i check the log table all i get in the command executed is sp_executesql;1, this is of course of no help to track down bad management of the data of that table, what i need to know is that if there's a way to get the command being executed the mentioned SP and how.

    Any help or clues to get started would be greatly appreciated

    PS. i've been checking the SPs used by the profiler, but is confusing and the BOL are missing a lot of info


    Kindest Regards from Mexico,

    Jose Torres

  • I suggest that you log the changed data, instead of the commands to update it. You can find the old data in the deleted table and the new data in the inserted table. For more informations, see:

    http://msdn.microsoft.com/library/en-us/createdb/cm_8_des_08_0lo3.asp

    http://qa.sqlservercentral.com/columnists/sjones/auditingyoursqlserverpart4selectiveauditing.asp

    Razvan

  • thanks for your reply, but i already know how to do that, but loggin the updated/deleted data is of no use for me, as i need to know who and how changed it, in order to make the necesary actions


    Kindest Regards from Mexico,

    Jose Torres

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

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