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)
 Checking for numeric data type

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-03-31 : 22:53:22
Dale writes "I have a text file that is being imported into a sql table periodically. The data is a mixture of text and numeric data so I store it in a varchar field. In my stored procedure, I query the field value and if it is numeric I need to cast it to a real value and use it in an arithmetic operation. Obviously, if it is text I can't do that, but I would like a way to know if the value is numeric before getting an error on the cast. I am looking for something like an IsNumeric() function in VB. Any ideas?
Thanks."

graz
Chief SQLTeam Crack Dealer

4149 Posts

Posted - 2002-03-31 : 22:53:22
I'd suggest the IsNumberic function in SQL Server. We don't have an article on it but Books Online has a good description.
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2002-04-02 : 06:24:38
be aware that ISNUMERIC may not behave the way you think it might....
it has a few uneven edges! as long as you recognise them, then it'll be fine for you.


see the conversation below..
http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=11722

Go to Top of Page
   

- Advertisement -