Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

SQL - appending a text field help

  • 23-04-2006 07:44PM
    #1
    Closed Accounts Posts: 920 ✭✭✭


    I have a field that contains say web addresses separated by a ^ symbol.
    If I have www.google.com^www.yahoo.com^, what would be the command to add another address to this field (called addresses) without deleting whats already there.


Comments

  • Registered Users, Registered Users 2 Posts: 2,781 ✭✭✭amen


    Update TableName
    set Fieldname = FieldName + '^www.cnn.com'
    where fieldname = whatever
    should do it


  • Closed Accounts Posts: 920 ✭✭✭elvis2002


    thanks, thats it.


  • Registered Users, Registered Users 2 Posts: 131 ✭✭theexis


    You could also use UPDATETEXT for a non-logged approach if the field will contain large blocks of text


  • Registered Users, Registered Users 2 Posts: 2,587 ✭✭✭optiplexgx270


    elvis2002 wrote:
    I have a field that contains say web addresses separated by a ^ symbol.
    If I have www.google.com^www.yahoo.com^, what would be the command to add another address to this field (called addresses) without deleting whats already there.
    i wont ask why its done like this :confused:

    But just to say that that should be in its own table with a foreign key etc.


Advertisement