Removal Of tabs from varchar field

  • Hi all,

    I need to search a field in all rows of a table for tab characters and replace them with spaces. Can anyone help me with a script for this.

    Thanks

    CCB

  • do a replace on the ascii number for a tab:

    select ascii(' ') -- 9

    update table set field = replace(field,char(9),' ')

    /* optionally*/ where field like '%' + char(9) + '%'

  • Perfect.

    Thank you

    CCB

Viewing 3 posts - 1 through 2 (of 2 total)

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