I put together an inline table valued function to produce a table. I have 3 stored procedures that select from this function. 1 takes the results and concatenates to a single column (let's call it proc A). The other 2 (let's call them proc B & C) present the contents of that table in the columns returned by the function.
All 3 stored procedures were functioning properly. Somewhere along the way proc B & C started failing with "Internal Error. Buffer provided to read column value is too small. Run DBCC CHECKDB to check for any corruption". Proc A continued to function properly.
We are running SQL Server 2008 R2. We tried restarting SQL server. We also tried clearing the proc cache. I've seen other posts on this error but related to doing a SELECT INTO #temptable or related to linked servers. I'm doing neither.
We ran DBCC CHECKDB and no errors were returned.
I copied the code out of proc B & C and ran in query analyzer with no errors. However when proc B & C were executed as stored procedures they continued to return this error. I tried the WITH (RECOMPILE) option to no avail. I also tried aliasing the table valued function differently in each proc.
The only way I was able to get around this was to create a copy of the table valued function with a new name and reference this function from procs B & C. Error disappeared. no changes to the table valued function or the procs aside from the name of the function.
I wondered if I changed procs B & C back to using the original function name whether the error would reappear. It does not.
I'm concerned this issue will reappear in a production environment as we are currently in testing. What is the true meaning of this error message?