Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server 2000/2005 Syntax Clarification
Message
From
17/08/2006 08:20:20
 
 
To
17/08/2006 08:17:15
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01146192
Message ID:
01146312
Views:
22
Right now it appears that it is truncating it at 8000.



Is this what you are referring to:

Conversion from large-value data types, such as varchar(max), to a smaller counterpart data type, such as varchar, is an implicit conversion, but truncation will occur if the large value is too big for the specified length of the smaller data type.


Can you clarify Fabio? I'm not sure I understand what you wrote. What extra characters will be lost using cast()?

This appears to work:
select * from mymain where my_id = '01047'
set concat_null_yields_null off
update mymain set notes = cast(notes as varchar) + 'and Test...' WHERE my_id = '01047'
select * from mymain where my_id = '01047'
set concat_null_yields_null on
After running the UPDATE line, 'and Test...' is appended to the end of the field.

Would convert work better? I thought they had similar functionality...



>>Someone in the office figured out that CAST() works...
>>
>
>of course. CAST declare that you accept the loss of extra characters.
>
>>http://msdn2.microsoft.com/en-us/library/ms187928.aspx
>>
>>
>
>>>Well, Chad that works great! However, I just checked the second table and it is text not char so it doesn't work on that. What would work with a text field type in sql server?
>>>
>>>
>>>
>>>
>>>
>>>>Tracy,
>>>>
>>>>Just RTRIM() the name inside the ISNULL().
>>>>
>>>>HTH,
>>>>Chad
>>>>
>>>>
>>>>>update tbl_main set name = isnull(name,'') +' MORE STUFF TO ADD TO NAME FIELD' where my_id = '01-011'
>>>>>
>>>>>
>>>>>Why not? It returns string or binary data would be truncated.
>>>>>
>>>>>Cannot do this either because it is a char:
>>>>>
>>>>>update tbl_main set name .write (N' MORE STUFF',NULL,0) where my_id = '01-011'
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform