Results 1 to 3 of 3

Thread: How to check for a numeric value in a column

  1. #1
    Join Date
    Oct 2002
    Location
    queens
    Posts
    139

    How to check for a numeric value in a column

    Hello All,

    Can someone pls help me with how to check for a numeric value in a varchar column?

    For example I have a column called client_id , it has values "AB" , "CD" , "18", "19" . I need to delete those client_id where the values are 18 and 19. How would I do that?

    Thanks in advance!!

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    create table mytable1 (name varchar(2))
    insert into mytable1 select 'AB'
    insert into mytable1 select 'CD'
    insert into mytable1 select 'EF'
    insert into mytable1 select '18'
    insert into mytable1 select '19'

    delete from mytable1 where isnumeric(name)=1

  3. #3
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    if you have values like '1233E23' that is considered to be numeric cas' E stands for exponential.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •