Vorrei condividerla con voi.
CREATE FUNCTION [dbo].[RemoveNumbers]
(
@string VARCHAR(8000)
)
RETURNS VARCHAR(8000)
AS
BEGIN
DECLARE @IncorrectCharLoc SMALLINT
SET @IncorrectCharLoc = PATINDEX('%[^A-Za-z]%', @string)
WHILE @IncorrectCharLoc > 0
BEGIN
SET @string = STUFF(@string, @IncorrectCharLoc, 1, '')
SET @IncorrectCharLoc = PATINDEX('%[^A-Za-z]%', @string)
END
SET @string = @string
RETURN @string
END
Esempio di utilizzo query:
select dbo.zzRemoveNumbers('123p//r(%% o.,.,v''a') as Risultato
Risultato query:










0 commenti:
Posta un commento
Grazie per aver visitato TheICTAuthority. Nel caso in cui il tuo commento sia una richiesta ti risponderemo al più presto.