How can I replace/change/delete characters in a SQL Server column?

Neil Pike

March 4, 1999

1 Min Read
ITPro Today logo in a gray background | ITPro Today

A. SQL has a reasonably full set of string manipulation tools - alldoc'd in the BOL. Some are detailed below.

  • RTRIM/LTRIM - for leading/trailing spaces

  • SUBSTR - standard substring

  • RIGHT

  • CHARINDEX/PATINDEX - find a particular char/pattern

  • STUFF - replace text at given offset(s)

  • REPLACE - SQL 7.0 only. Replaces chars anywhere in a column

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like