March 4, 2013 at 10:14 pm
Hi Guys
I have a table called Mytable.
In it are 2 columns, Description(50 Char) and Longdescription(200 char)
I need to copy the content of longdescritption(data with more tha 50 characters) into my descritption table.
I dont mind if it copys the first 50 characters of the data and truncates the rest.
How do I acheive this ?
Thanks in advance.
A
March 4, 2013 at 11:10 pm
Hi,
if the column Description(50 Char) doesn't have any value (or values can be overwritten) and you need to copy values to it from Longdescription(200 char) column, you can use the next query:
update Mytable set Description=substring (Longdescription, 1, 50)
if the column Description(50 Char) has some values that you don't want to be overwritten, you can add values from Longdescription(200 char) to the end of the Description(50 Char) column:
insert into Mytable (Description)
select substring(Longdescription, 1, 50) from Mytable
March 5, 2013 at 3:26 pm
Hi SSCveteran
Thanks you for the assistance, worked great.
Im pretty new to this and appreciate the assistance.
A
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply