• jimmy.white 20227 - Friday, April 28, 2017 9:45 AM

    Nice code.

    Be good to point out that it only works only on complete column values not partial.

    Also I have one enhancement.
    It didn't work on one of my tables and I found out it was because the column Name was "To" for email values.
    Change the EXEC line in the code to this:

    EXEC ( 'Update '+@TableName+ ' Set ['+ @ColumnName+'] = '+''''+@ReplaceWith+''''+ ' Where ['+@ColumnName+'] = '+''''+@SearchThis+'''')

    And it will work!

    Thanks for pointing​ out.