Se siete semplicemente selezionando poi fare:
Select Replace(textct, Special_char, ' ')
from mytable
se si sta aggiornando quindi fare questo:
Update mytable
Set textct = Replace(textct, Special_char, ' ')
presupponendo che siano nvarchars quindi fare questo:
Select Replace(cast(textct as varchar),cast(Special_char as varchar), ' ')
from mytable
Se si desidera rimuovere tutti i caratteri speciali è necessario utilizzare una funzione iOn come questo:
Create Function RemoveSpecialCharacters (@text nvarchar(max))
Returns varchar(4000)
AS
BEGIN
Declare @Return varchar(4000) = Cast(@text as varchar(4000))
While PatIndex('%[^a-z ]%', @Return) > 0
Set @Return = Stuff(@Return, PatIndex('%[^a-z ]%', @text), 1, ' ')
Return @Return
END
Select RemoveSpecialCharacters(textct) from mytable
fonte
2015-05-06 12:47:04
Cosa hai provato? –
potresti scrivere una funzione sql che rimuove tutti i valori non di carattere (o hai bisogno anche di numeri?) –
Perché questo taggato è netezza? –