April 11, 2002 at 9:06 am
Hi everybody!
I have a table with following values
Name
----
Bill
Jim
Anton
I would like to create an update statement which concatenates to the existing value a number
So after I run the update statement i will have:
Name
----
Bill 3213
Jim 3213
Anton 3213
Is there a way to do this without using a cursor, that will take each record and concatentes the number? Just a simple update statement??
Thanks,
Duruguru
April 11, 2002 at 9:21 am
UPDATE tblName SET [Name] = [Name] + ' 3213'
Thsi si based on your example, if this is not what is being done please specify.
"Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)
April 11, 2002 at 9:32 am
I tryed the same statement and I got this error when I tryed in QA before posting this question
String or binary data would be truncated.
The statement has been terminated.
So I got scared :))
I had to add the rtim function
Thank you a lot!
April 11, 2002 at 9:47 am
Ok so I guess rtrim got it (must be a char field). The reason you would ever get "String or binary data would be truncated" would be if the field is not wide enough for the new data.
"Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply