Using Substring to Update data in a column

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • josh24
    New Member
    • Oct 2006
    • 1

    Using Substring to Update data in a column

    In MS SQL Server I need to update a substring of data within a column based on a change to two parts of the string.

    The column accountcode exists currently as:

    0100-0001

    I need to change this to

    10-0004-9999-000006

    The logic to this change is:

    0100 changes to 10-0004-xxxx-000006

    and 0001 changes to xx-xxxx-9999-xxxxxx

    I can perform a replace command to change the second 'segment' in the column first, as this is unique. How would I then go about changing the rest of the string around it?
  • Fausto Guerini
    New Member
    • Oct 2006
    • 4

    #2
    Where does the change rule come from? You have a transformation table?
    Explain better please.
    Hi
    Fausto

    Comment

    Working...