Home Forums SQL Server 7,2000 T-SQL Break up full name col into fname, lname cols RE: Break up full name col into fname, lname cols

  • This may seem easy, but is rife with potential problems. My last name is two words...

    If all your data is indeed three strings delimited by single spaces, you could just try something like this:

    UPDATE YourTable
    
    SET LName = PARSENAME(REPLACE(LTRIM(RTRIM(IndName)),' ','.'),3),
    FName = PARSENAME(REPLACE(LTRIM(RTRIM(IndName)),' ','.'),2),
    MName = PARSENAME(REPLACE(LTRIM(RTRIM(IndName)),' ','.'),1)

    --Jonathan



    --Jonathan