Ilianam
asked on
remove numbers in a sql string
I have a field from where I want to remove the numbers.
Examples
12 Me me
125 just think
56 again
I doesn't have a pattern. Should I use PATINDEX or CHARINDEX?
Examples
12 Me me
125 just think
56 again
I doesn't have a pattern. Should I use PATINDEX or CHARINDEX?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No, your will not need a cursor, mcmonap's code above will update the netire column. It'll just simply replace any intergers, 0-9 with ''. If they do not exist in a certain record, nothing will take place.
If you need to update mutiple columns, you can include that in the one update statement. e.i.:
UPDATE <your table name> SET <col1> = REPLACE(col1,@i,''), <col2> = REPLACE(col2,@i,''), <col3> = REPLACE(col3,@i,'')
UPDATE <your table name> SET <col1> = REPLACE(col1,@i,''), <col2> = REPLACE(col2,@i,''), <col3> = REPLACE(col3,@i,'')
ASKER