469,148 Members | 1,567 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,148 developers. It's quick & easy.

Checking the type of a variable in SQL

Is there a way to check the type of a variable in SQL? I want to know
if a variable is a float or a string.

Thanks,
Ramzi
Jul 20 '05 #1
1 1931
Hi

I assume you mean that you want to check the contents of a string to see if
it is a numeric value. There is a ISNUMERIC function (see books online) but
to avoid problems with comma being recognised as a decimal point then you
may want to use patindex instead and check for any character then is not 0-9
or decimal point. Such as http://tinyurl.com/45ejw

John

"Ramzi Abboud" <ra******@gmail.com> wrote in message
news:a5**************************@posting.google.c om...
Is there a way to check the type of a variable in SQL? I want to know
if a variable is a float or a string.

Thanks,
Ramzi

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.