Search and Replace in TSQL

  • Hello Everyone,

    I have one filed in the database for addresses, somehow all addresses stored like eg. '7 station rd,NYPD', could anyone guide me easy way to update the field without '. eg. 7 station rd,NYPD.

    Thanks.

  • If ALL addresses have the start and end quote, you could do something like this:

    select stuff(stuff(MyAddr, LEN(MyAddr), 1, ''), 1, 1, '')

    from MyTable

  • You are a Super Star!!!! Great!!!

  • The REPLACE function is another option.

  • homebrew01 (3/22/2012)


    The REPLACE function is another option.

    Only if there are no single quotes within the address field.

  • Reply removed.

Viewing 6 posts - 1 through 5 (of 5 total)

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