Re: Remove letters in column
- From: Hugo Kornelis <hugo@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 19 May 2005 23:04:18 +0200
On Wed, 18 May 2005 16:28:01 -0700, DCR wrote:
>I have a column that have numbers & letters combined in a field. What sql
>command would remove the letters only, not the numbers?
>I have a table called ?customer? and the column in that table is called
>?customtext4?. I want to change over 5000 records in this ?customtext4? field
>
>Thanks for your help
>Dave
Hi Dave,
String manipulation is a weak spot in SQL Server's command set. This can
be done, but it's clumsy:
UPDATE Customer
SET CustomText4 = REPLACE(
REPLACE(
REPLACE(
....
REPLACE(CustomText, 'A', '')
, 'B', '')
, 'C', '')
.....
, 'Z', '')
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)
.
- References:
- Remove letters in column
- From: DCR
- Remove letters in column
- Prev by Date: RUSSIAN SQL PROBLEM
- Next by Date: hierarchy structure
- Previous by thread: Remove letters in column
- Next by thread: RUSSIAN SQL PROBLEM
- Index(es):
Relevant Pages
|
|