Remove a character from a string

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • saiprasanthi
    New Member
    • Oct 2006
    • 7

    Remove a character from a string

    Hi All,

    Please guide me how to completely remove a particular character from a string in Sql Server 2000 and display remaining characters of the string.

    Thanks in advance.

    Regards
    Prasanthi
  • scripto
    New Member
    • Oct 2006
    • 143

    #2
    declare @mytxt varchar(50)
    set @mytxt = 'abc123def'


    --remove the 2 from the string
    set @mytxt = replace(@mytxt, '2', '')
    select @mytxt

    Comment

    • sukeshchand
      New Member
      • Jan 2007
      • 88

      #3
      Run this simple Query
      this will Replace all s from the name field with blank

      select replace(name,'s ','') from sysobjects

      Comment

      Working...