Monday, May 25, 2009

Running a SQL query to replace certain characters in a table

Let say,
You have a database that contains many characters and symbols. If you want to replace those , just run the following SQL query:

(Here, suppose a symbol ~! need to replace by - then your query will be:)

UPDATE table
SET ColumnName= replace(LTRIM(RTRIM(ColumnName)), '~!', '-')

Happy Programming!:)

No comments:

Post a Comment

Highly Appreciated your comments