Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 varchar column

Author  Topic 

sent_sara
Constraint Violating Yak Guru

377 Posts

Posted - 2006-12-11 : 03:28:11
hi fys
iam storing integer value in a varchar data type.while querying just i need to know whether stored value is integer or character value?????

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-12-11 : 03:30:07
Make use of ISNUMERIC() function.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-12-11 : 03:33:11
-- to get non-numeric content
select yourcolumnnamehere from yourtablenamehere
where yourcolumnnamehere like '%[^0-9]%'

-- to get numeric content
select yourcolumnnamehere from yourtablenamehere
where yourcolumnnamehere not like '%[^0-9]%'


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-12-11 : 06:29:57
quote:
Originally posted by harsh_athalye

Make use of ISNUMERIC() function.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"

IsNumeric is not reliable
http://aspfaq.com/show.asp?id=2390

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-12-11 : 06:37:46
That was good information, Madhivanan!

Thanks.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -