Intermittent string truncation error - ADO DAO RDO RDS
This is a discussion on Intermittent string truncation error - ADO DAO RDO RDS ; Using SQL 2005
We have a proc that we are calling from an ASP.NET application using
ADO.NET. It is intermittently return the following error message: 'Error
executing the command exec [proc_name] to DataSet. String or binary data
would be truncated. ...
-
Intermittent string truncation error
Using SQL 2005
We have a proc that we are calling from an ASP.NET application using
ADO.NET. It is intermittently return the following error message: 'Error
executing the command exec [proc_name] to DataSet. String or binary data
would be truncated. The statement has been terminated.'
If I run the same proc in SQL, it is never returning the error. If I
compile the proc and access my web page again, the query runs fine. After a
length of time (not sure exactly what length or what other factors there
might be), the query returns this error again in the web page.
I am trying to narrow down what the issue might be. Based on the error, it
seems like a fairly straightforward thing to hunt down in SQL, but I am not
getting the error in SQL (EVER!). To be on the safe side, I have reviewed
the code to make sure that there are no places that truncation could happen.
I am wondering if SQL is trying to recompile the proc and if that could
possible cause this error.
Any help or pointers in how to troubleshoot this would be greatly appreciated!
-
Re: Intermittent string truncation error
Generally this is caused when you try to insert or update a value in a
column that is too small to hold the value. For instance, trying to put
'EMMA' into a CHAR(2) column. I would check the column widths for columns
that are updated/inserted in the stored procedure first. There may be a
string concatenation taking place in your client app or in the stored
procedure prior to the insert or update.
"Emma" <Emma@discussions.microsoft.com> wrote in message
news:096A2C6F-989E-4EF5-AC0D-D2D081C636A3@microsoft.com...
> Using SQL 2005
>
> We have a proc that we are calling from an ASP.NET application using
> ADO.NET. It is intermittently return the following error message: 'Error
> executing the command exec [proc_name] to DataSet. String or binary data
> would be truncated. The statement has been terminated.'
>
> If I run the same proc in SQL, it is never returning the error. If I
> compile the proc and access my web page again, the query runs fine. After
> a
> length of time (not sure exactly what length or what other factors there
> might be), the query returns this error again in the web page.
>
> I am trying to narrow down what the issue might be. Based on the error,
> it
> seems like a fairly straightforward thing to hunt down in SQL, but I am
> not
> getting the error in SQL (EVER!). To be on the safe side, I have reviewed
> the code to make sure that there are no places that truncation could
> happen.
>
> I am wondering if SQL is trying to recompile the proc and if that could
> possible cause this error.
>
> Any help or pointers in how to troubleshoot this would be greatly
> appreciated!
-
Re: Intermittent string truncation error
On Oct 11, 10:27 pm, Emma <E...@discussions.microsoft.com> wrote:
> Using SQL 2005
>
> We have a proc that we are calling from an ASP.NET application using
> ADO.NET. It is intermittently return the following error message: 'Error
> executing the command exec [proc_name] to DataSet. String or binary data
> would be truncated. The statement has been terminated.'
>
> If I run the same proc in SQL, it is never returning the error. If I
> compile the proc and access my web page again, the query runs fine. After a
> length of time (not sure exactly what length or what other factors there
> might be), the query returns this error again in the web page.
>
> I am trying to narrow down what the issue might be. Based on the error, it
> seems like a fairly straightforward thing to hunt down in SQL, but I am not
> getting the error in SQL (EVER!). To be on the safe side, I have reviewed
> the code to make sure that there are no places that truncation could happen.
>
> I am wondering if SQL is trying to recompile the proc and if that could
> possible cause this error.
>
> Any help or pointers in how to troubleshoot this would be greatly appreciated!
did your run Profiler to record which parameters does it fail with?
Similar Threads
-
By Application Development in forum DOTNET
Replies: 0
Last Post: 09-25-2007, 08:40 AM
-
By Application Development in forum JDBC JAVA
Replies: 0
Last Post: 10-11-2006, 08:13 AM
-
By Application Development in forum JDBC JAVA
Replies: 4
Last Post: 04-14-2006, 03:41 AM
-
By Application Development in forum ADO DAO RDO RDS
Replies: 0
Last Post: 06-23-2005, 03:23 AM
-
By Application Development in forum Inetserver
Replies: 6
Last Post: 04-18-2005, 04:09 PM