ADO SQL Server update of long strings 
Author Message
 ADO SQL Server update of long strings

I am performing an embedded SQL update of a record that
has a 3000 byte column within it. The update fails with
the message

"String or binary data would be truncated."

I finally got the update statement to succeed when a cut
downn  the string to 1000 bytes.

Does anybody know why this is happening?



Mon, 07 Mar 2005 03:15:33 GMT  
 ADO SQL Server update of long strings
Hi,

It could be a limit on length of query. Which version of SQL Server are you
using?

--
Val Mazur
Microsoft MVP


Quote:
> I am performing an embedded SQL update of a record that
> has a 3000 byte column within it. The update fails with
> the message

> "String or binary data would be truncated."

> I finally got the update statement to succeed when a cut
> downn  the string to 1000 bytes.

> Does anybody know why this is happening?



Mon, 07 Mar 2005 03:27:49 GMT  
 ADO SQL Server update of long strings
SQL Server 2000 SP1

I heard there was some sort of memory leak bug with
strings over 16k. I'm gonna research it, but strangely
enough, when I pared down the length of the enbedded sql
statement, ie.

"update mytable set notes=trim(" & left
(txtnotes.text,1000) & " where ..."

It could only use 1000, not one byte more.

Quote:
>-----Original Message-----
>Hi,

>It could be a limit on length of query. Which version of
SQL Server are you
>using?

>--
>Val Mazur
>Microsoft MVP


message

>> I am performing an embedded SQL update of a record that
>> has a 3000 byte column within it. The update fails with
>> the message

>> "String or binary data would be truncated."

>> I finally got the update statement to succeed when a cut
>> downn  the string to 1000 bytes.

>> Does anybody know why this is happening?

>.



Mon, 07 Mar 2005 22:48:47 GMT  
 ADO SQL Server update of long strings
I found out some things:
1. I extracted the code into Query Analyzer and tried it
there. It failed with the same error. So, it seems to be
saying that you should be using varchar strings over 1024
bytes.
2. I redefined the column as a 'text' datatype and
everything works fine.

Thanks for listening

Quote:
>-----Original Message-----
>Hi,

>It could be a limit on length of query. Which version of
SQL Server are you
>using?

>--
>Val Mazur
>Microsoft MVP


message

>> I am performing an embedded SQL update of a record that
>> has a 3000 byte column within it. The update fails with
>> the message

>> "String or binary data would be truncated."

>> I finally got the update statement to succeed when a cut
>> downn  the string to 1000 bytes.

>> Does anybody know why this is happening?

>.



Tue, 08 Mar 2005 00:37:44 GMT  
 ADO SQL Server update of long strings
Hi,

Limit for varchar/char data type in SQL Server 7 and 2000 is 8000
characters. It should work fine. I think problem is in something else

--
Val Mazur
Microsoft MVP


Quote:
> I found out some things:
> 1. I extracted the code into Query Analyzer and tried it
> there. It failed with the same error. So, it seems to be
> saying that you should be using varchar strings over 1024
> bytes.
> 2. I redefined the column as a 'text' datatype and
> everything works fine.

> Thanks for listening

> >-----Original Message-----
> >Hi,

> >It could be a limit on length of query. Which version of
> SQL Server are you
> >using?

> >--
> >Val Mazur
> >Microsoft MVP


> message

> >> I am performing an embedded SQL update of a record that
> >> has a 3000 byte column within it. The update fails with
> >> the message

> >> "String or binary data would be truncated."

> >> I finally got the update statement to succeed when a cut
> >> downn  the string to 1000 bytes.

> >> Does anybody know why this is happening?

> >.



Tue, 08 Mar 2005 01:10:46 GMT  
 ADO SQL Server update of long strings
Finally figured it out.
I had a trigger behind the table update and the column on
the journal file was 1024 bytes....duh

Quote:
>-----Original Message-----
>Hi,

>It could be a limit on length of query. Which version of
SQL Server are you
>using?

>--
>Val Mazur
>Microsoft MVP


message

>> I am performing an embedded SQL update of a record that
>> has a 3000 byte column within it. The update fails with
>> the message

>> "String or binary data would be truncated."

>> I finally got the update statement to succeed when a cut
>> downn  the string to 1000 bytes.

>> Does anybody know why this is happening?

>.



Tue, 08 Mar 2005 01:31:22 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. SQL Server (ADO) Can't Insert Strings Longer Then 30 characters

2. ADO SQL Server updating cursors

3. ADO Updates to SQL Server not Showing, though records affected shows true

4. ADO, SQL Server Updating Recordset using 2 Tables

5. SQL ADO Update speed problem w/proxy server

6. SQL Server 7.0 and ADO Batch Updating (UpdateBatch)

7. ADO against SQL Server - empty string returned as a space

8. ADO NT Trusted Connection String to SQL Server.

9. ADO Connection string to SQL Server

10. ADO connection string for SQL Server

11. ADO against SQL Server - empty string returned as a space

12. VB Sql Server Via ADO Problem: [Microsoft][ODBC Sql Server Driver]

 

 
Powered by phpBB® Forum Software