Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 text size limit

Author  Topic 

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2005-03-15 : 02:17:22
Hi all

Sorry for the dumb question - but I'm a newbie with text.

I have a friend (OK we've all heard that one before) who has a problem. A string value is failing to be inserted into a text field when it has more than 32767 characters. My friend is using a ADODB Command object - using concatenated VB strings to set up the SQL INSERT.

Is there something simple and obvious which my friend is doing which is limiting her text field to this size? Is it an ADODB setting?

appreciate any pointers

Cheers all

PS- I doubt she has text in row turned on, although I still have to check this...

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2005-03-21 : 20:25:16
Turns out it was a dumb question -

my "friend" had some code which was doing an implicit conversion from text to varchar, and the problem was at 8000 chars, not 32767.

(Last time I post on someone else's behalf!!)

Cheers

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page

SqlStar
Posting Yak Master

121 Posts

Posted - 2005-03-21 : 23:58:02
Can you post that code snippet, which is your friend written?

:) While we stop to think, we often miss our opportunity :)
Go to Top of Page

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2005-03-22 : 00:07:29
Sorry no - its from a classfied environment - you wouldn't believe the paperwork I'd have to do through....

:(

Basically it was it turned out she was trying to union a text field with a null value - which you can't do
1. - because you can't do a distinct on a text and a union is implicitly a distinct
2. - because the null was assumed to be a varchar and so the compiler was spitting because the text value didn't fit...

eg
select null as field1
union
select textvalue as field1
from table

try it sometime....

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page

SqlStar
Posting Yak Master

121 Posts

Posted - 2005-03-22 : 02:49:08
I agree with you.

:) While we stop to think, we often miss our opportunity :)
Go to Top of Page
   

- Advertisement -