Problem with Print command in sp_executesql | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Problem with Print command in sp_executesql

Hi gurus, I’, getting a problem with the log file for sql agent jobs. I execute all loading jobs from one server, some of which includes SPs to be executed on linked server and hence I execute them using sp_executesql. the problem is, in the log file of the job, I’m not getting any of the comments that I use with Print statement, while all results for select statements and rowcounts are available. I’was not able to simulate this issue always. I trend seems to be .. with long running queries.. any suggestion are welcome, as this would help me to make the output log file more meaningful. thanks –smk

May chekc the process using PROFILER as you say it is appearing with long running queries. Satya SKJ
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
Hi Satya,
I got a quick work around for this issue, by replaceing print with select. i hope it will work.. i will keep ur suggestion in mind next time i run this job. but what i’m wondering is that, like there is a character limitation in sql agent job steps, is there any know limitation for characters returned in sp_executesql???. thanks buddy,