Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004
    Posts
    2

    Unanswered: Update a varchar field

    I would like to append information to a varchar field with an update statement, for example the field currently contains a name (Mark) and I would like to add information to name for business purposes, to update it to Markqw215, is this possible to do with an update statement?
    Thank you.

  2. #2
    Join Date
    Dec 2002
    Posts
    1,245
    Code:
    CREATE TABLE MyTable (
        MyString varchar(50) null,
    )
    GO
    
    INSERT INTO MyTable (MyString)
    VALUES ('Mark')
    GO
    
    UPDATE MyTable
    SET MyString = MyString + 'qw215'
    WHERE MyString = 'Mark'
    GO
    
    SELECT MyString FROM MyTable
    GO
    
    DROP TABLE MyTable
    GO
    Regards,

    hmscott

    Quote Originally Posted by wyogirl77
    I would like to append information to a varchar field with an update statement, for example the field currently contains a name (Mark) and I would like to add information to name for business purposes, to update it to Markqw215, is this possible to do with an update statement?
    Thank you.
    Have you hugged your backup today?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •