Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I replace number
Message
From
18/02/2005 19:49:09
 
 
To
18/02/2005 16:26:03
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00988494
Message ID:
00988534
Views:
23
>In a table, we have a char column. The data like these:
>
>No. 1349, High Street
>5617 good drive way
>
>We want delete all number in this columns. We want to use Replace functiion, but we can't use range [0-9].
>
>Please help
>
>
>Jim
DECLARE @myString VARCHAR(50)
SELECT @myString='No. 1349, High Street'
-- start : uses a dummy select variable for fill the @@ROWCOUNT
WHILE @@ROWCOUNT>0
   -- uses  the UPDATE table .... where PATINDEX .... here
    select @myString=STUFF(@myString,patindex('%[0-9]%',@myString),1,'') WHERE patindex('%[0-9]%',@myString)>0
--- end
SELECT @myString
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform