Response truncated when run as a job [SQL Server 2005]

  • I have a procedure that uses OLE automation procedures to make web requests and returns responses. The problem is that when i run the stored procedure as a job, the reponse is limited to 512 characters. But when running the SP with SSMS, it works fine. Do i have to change SQL Agent settings ?

  • Try using the SQLCLR to implement web requests. There is no practical limit within .NET (2GB string) for response sizes.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • I don't know much about SQLCLR. That's why i prefer using OLE automation procedures. But it's weird, because it seems to be one parameter that causes the limitation. But i don't know wich parameter.

  • Use this as an opportunity to learn a new technique, you won't be sorry 😉

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • Yes, I understand and i would love to learn that technique. I just want to be sure that there is no way to make it work withe SQl Agent.

  • I found the solution to my problem.

    SQL Server agent's default textsize is 1024 whereas SSMS default is 2147483647.

    So specifiying SET TEXTSIZE 2147483647 solves the problem. This might be useful for those who have the same problem 😉

    Thanks a lot opc.three for taking time to answer my question.

    🙂

  • amosafr2003 (5/30/2012)


    Thanks a lot opc.three for taking time to answer my question.

    🙂

    Anytime. Thanks for posting the solution for others to see. Check out SQLCLR when you have a moment 😉

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • Ok I will take a look.

    Thanks.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply