I’ve been looking for a while for a way to trace from SQL stored procedure on SQL Server.
I am talking about tracing to “DebugView”, just like the function OutputDebugString() (or C#’s Trace.WriteLine()).
Does anyone know how to do that, or if it is even possible?
Thanks! 🙂
How are you executing these stored procedures? If from SSMS print statements are quickest and easiest if from your application you can use custom SQL Profiler Events.
You could toggle logging off and off by altering the connection string.