Weird result from update

  • Hi there, We run this statement and get weird result in some fields:

    update wtMaster

    set pFirstName = substring(first_middle, 1, patindex('% [A-Z].', first_middle)),

    pMiddleInitial = substring(first_middle, patindex('% [A-Z].', first_middle) + 1, 1)

    where first_middle like '% [A-Z].' and pFirstName is null

    Some rows get the following result:

    "Middle initial parsed from first_middle"

    There is data in the first_name field. Any idea why this might happen? Thanks in advance.

  • quote:


    "Middle initial parsed from first_middle"


    If you are getting that as a result then there is data with that in it you are parsing from first_middle.

  • No, the data looks fine. I select * from the whole table and the data in first_middle is fine. Thanks.

  • Never mind, the entry was a default value.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply