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.
| Author |
Topic |
|
padsp
Starting Member
21 Posts |
Posted - 2006-03-08 : 16:09:35
|
| Hi,I have a table with the following structure:Table: MeetingID integer not nullDesc text nullHere Col 'Desc' is a text type stores description. I have used the following UPDATE query:UPDATE Meeting SET Desc='New Updated text......' + ' ' + CAST(Desc as varchar) WHERE ID=100Issues:1. Since i did'nt specify lenth for varchar it takes only 30 chars from existing value and added to the edited text.2. If i give like this CAST(Desc as varchar(8000)); it might take only first 8000 chars; remaining would be truncated correct? I assume that will happen.3. If i don't use CAST i get error msg: "Invalid operator for type.."Is there any work around in this situation? or better way to do it.Looking for your help.ThanksBoB |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2006-03-08 : 16:34:20
|
| Did you try the vachar(8000) cast to see what happens? That's the best way to learn. And don't try it on production data, throw a quick little test together. Let us know how it goes. |
 |
|
|
padsp
Starting Member
21 Posts |
Posted - 2006-03-08 : 17:05:13
|
| HiThank you for asking me to try. I did try. when i check the LEN for Desc col - shows 8000 chars. |
 |
|
|
|
|
|