Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Location
    Melbourne
    Posts
    144

    Unanswered: T-SQL text columns

    I actually extracted a set of from an email to excel then to a SQL Server table
    I'm trying to update a column in a database to clean out everything except the name "George Jeffrey"

    bodytext1 column :-
    " The following person is leaving the department, please update your records accordingly. Person Leaving: George Jeffrey/Users/DVC Division/Agency: People and Community Advocacy Date Leaving: Thursday 10, November 2005 "


    I tried to use the replace method

    update test.dbo.test
    set bodytext1 = REPLACE(bodytext1,'The following person is leaving the department','')

    but this error came out

    Server: Msg 8116, Level 16, State 1, Line 1
    Argument data type text is invalid for argument 1 of replace function.

    Is there another way to do this ?

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    avoid TEXT data types whenever possible. I believe you want to look at at UPDATETEXT in SQL Server Books Online.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

Posting Permissions

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