Re: Remove letters in column

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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)
.



Relevant Pages

  • Re: Getting results of a FOR Command
    ... I can issue the following command in SQL ... From Customer FOR XML AUTO ...
    (borland.public.delphi.database.ado)
  • Getting results of a FOR Command
    ... I can issue the following command in SQL ... From Customer FOR XML AUTO ...
    (borland.public.delphi.database.ado)
  • Re: COBOL stored procedure for DB2
    ... Regarding how you precompile the app, you must specify target mfcob to db2 prep, rather than target ibmcob. ... Have you also confirmed that, prior to executing the CALL statement, the host variables specified within the client app have the appropriate values? ... MODIFIES SQL DATA ... confirm the cob command used for creating the SP module. ...
    (comp.lang.cobol)
  • Re: COBOL stored procedure for DB2
    ... Have you also confirmed that, prior to executing the CALL statement, the ... The DB2 CREATE PROCEDURE statement. ... MODIFIES SQL DATA ... confirm the cob command used for creating the SP module. ...
    (comp.lang.cobol)
  • Re: Defeating The Top 1%; Request For Criticism
    ... The basic building block of all armies, such as the customer group, is ... The smallest group of soldiers organized to ... A platoon consists of 16 to 44 soldiers (2 ... concentrated within a single city neighborhood, would command a very ...
    (sci.econ)