• Anna Johansson - Friday, February 16, 2018 2:25 AM

    We are setting up audits to log stored procedure execution in our web application.

    When running a stored procedure from management studio the log includes "statement" which contains the nameo of the stored procedure AND which parameters (with values) that are sent to it.
    However when running the same stored procedure via the web application the "statement" in the log is empty. so you can see that the procedure was executed but not with which parameters.
    Does anyony knows why there is a difference? I'm running as the same sql user.

    BR
    Anna

    I had the same concern when I was setting up my database audit for executions. It's because RPC statements are not logged as mentioned in the Considerations section of the documentation here:
    https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions

    If you start a trace and look for the executions, you'll probably see that the one from your app initiates as RPC:Starting and the one from SSMS will be SQL:StmtStarting.