Forum Moderators: open

Message Too Old, No Replies

Adding text to end of column?

Adding text to the end of a column.

         

Menekali

11:56 pm on Jul 24, 2008 (gmt 0)

10+ Year Member



Hello everyone. Love this site, and have a quick question.

I'm working on a rather large database at the moment, and the structure looks like this:


Website varchar(50) latin1_swedish_ci No
Cat_ID varchar(50) latin1_swedish_ci No
ID varchar(50) latin1_swedish_ci No
ss_ID varchar(50) latin1_swedish_ci No
Alias varchar(50) latin1_swedish_ci No
Page_Title varchar(150) latin1_swedish_ci No
Meta_Description text latin1_swedish_ci No
Meta_Keywords text latin1_swedish_ci No
Title varchar(250) latin1_swedish_ci No
Body text latin1_swedish_ci No
Related_Resources text latin1_swedish_ci No
N_Date date No 0000-00-00

You can see the body is included in the database there. I need to append some text to the end of that column, for specific ss_IDs. We're talking thousands of pages.

Could someone show me how to get this done? Essentially I just need to run a query that will add text to the end of my Body column. I don't want to replace the entirety of it, and there's far too many differences in the pages to search for anything.

Any ideas? Thanks a ton in advance.

LifeinAsia

12:01 am on Jul 25, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



This should get you started (you may need some tweaking depending on your specific DB):
UPDATE TableName SET
Title=Title+'AddYourTextHere'
WHERE ss_ID IN (IDList)

NOTE: Did you really want ss_ID to be VARCHAR instead of INT?

[edited by: LifeinAsia at 12:01 am (utc) on July 25, 2008]

Menekali

2:47 pm on Jul 25, 2008 (gmt 0)

10+ Year Member



Yea they have it set up really weird here. Thanks a lot I'll give this a try today :D