-1

I have a nvarchar column in a table that contains the character % in its text, i want to remove or substring this character from this text, is there any way to do that

thanks in advance,

Maged

Maged Samaan
  • 1,742
  • 2
  • 19
  • 39
  • 2
    I don't think there's a specific `remove` function, but maybe you can `replace` it with nothing. – GolezTrol Jun 19 '13 at 15:15
  • 1
    You cant expect to get help if you tried nothing. – OzrenTkalcecKrznaric Jun 19 '13 at 15:15
  • Have you tried the replace function ? – Laurent S. Jun 19 '13 at 15:15
  • possible duplicate of [How to replace a string in a SQL Server Table Column](http://stackoverflow.com/questions/814548/how-to-replace-a-string-in-a-sql-server-table-column) – HABO Jun 19 '13 at 15:26
  • Does this answer your question? [How do you strip a character out of a column in SQL Server?](https://stackoverflow.com/questions/983417/how-do-you-strip-a-character-out-of-a-column-in-sql-server) – MB_18 Apr 17 '22 at 08:05

2 Answers2

9
UPDATE TableName SET ColumnName = REPLACE(ColumnName,'%','')
Kenneth Fisher
  • 3,692
  • 19
  • 21
0

If you want it from the query, then you can do this

SELECT REPLACE(columnName, '%', '') AS TrimmedValue
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Junaid
  • 1