Question

Using Sql Server 2008 r2 and I can get a process to work perfectly while executing it myself. When I set it up to run as a job, the binary field is getting truncated to 2kb (2048 characters) every single time. Below are the details of exactly what is going on.

Here is the basic process my stored procedure.

  • Dynamically build sql statement that inserts a data set (usually 10 to 15 rows) from a linked server to a user defined table variable. (The data set basically contains information about photos. mime/type, order, description, and the binary (or the blob) of the specific photo.)
  • That table variable is then passed to another stored procedure that saves the data set

As stated before, when I execute the stored procedure, the process works perfectly. The blob is a complete and generates a great looking photo. However when the stored procedure is executed via a scheduled job, the binary string is truncated after 2048 characters. And this happens every single time without fail.

I have been able to determine that the truncation is coming from OPENQUERY statement I'm using to pull the data out of the linked server, but I cannot figure out WHY it is happening during the scheduled job and not when I just run it. I would think it was a permission issue, it would just fail to pull back anything.

Thanks in advance for your help, Will

Was it helpful?

Solution

Take a look at documention in BOL for TEXTSIZE, and try setting it to a larger value in the stored proc.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top