Use SQL Debugger when stored proc called by an external process

前端 未结 1 525
梦如初夏
梦如初夏 2021-01-25 04:07

Is there something like a \"debug attach\" for the SQL debugger? I have a middleware tool (BizTalk) that is calling a stored procedure and would like to debug it.

As al

1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-25 04:47

    sp_TraceGenerateEvent is useful to write data to the profiler. (Example usage here: https://blogs.technet.microsoft.com/fort_sql/2012/06/21/capture-custom-events-in-profiler-for-troubleshooting/)

    Just beware that when BizTalk calls the stored proc, it has two passes, once with FmtOnly=On, and the second (the real execution) with FmtOnly=Off. You might not reach the second pass if you have certain errors on the first pass. Getting sp_tracegenerateevent to work in a stored procedure

    When FmtOnly=On, the Trace Profile can be confusing, leading you to believe it's running when it's really just checking for what data/columns will be returned. Can SQL Begin Try/Catch be lying to me (in the profiler)?

    0 讨论(0)
提交回复
热议问题