How can I get T-SQL PRINT statements to come up in SQL Server Profiler Traces?

点点圈 提交于 2019-12-05 06:14:55

You could use sp_trace_generateevent to "fire" an event out to your SQL trace. There's an example of it on the BOL page for the proc: http://msdn.microsoft.com/en-us/library/ms177548.aspx

Alternatively you can put a print statement into your stored procedure and execute the stored procedure in management studio (exec YourProcedure @Parameter1=10...) and on the messages tab you will see the print statement. If the procedure is running from an application with a lot of parameters you could trace the database to get the exec statement copy it and run it in management studio to see the print statements.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!