Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Converting string to numeric

0 views
Skip to first unread message

calber...@hotmail.com

unread,
Apr 23, 1999, 3:00:00 AM4/23/99
to
Hi all!

I need to make a trigger that verifies the data entered for a given
table on a specific column. The column is char(3), and I need to know if
the data inserted into it is integer. Is there any function in Transact
SQL to verify this? I didn't find out anything in SQL Server Books
Online. I've tried another solution, trying to use convert(int,
column_name) and testing after the global variable @@error (like an
exception), but it failed.

Can anyone help me?

Thanks in advanced,

Carlos

----- Posted via Deja.com, The People-Powered Information Exchange -----
------ http://www.deja.com/ Discussions * Ratings * Communities ------

morr...@my-dejanews.com

unread,
Apr 23, 1999, 3:00:00 AM4/23/99
to
select ISNUMERIC(column_name) returns a 1 or 0. It works nicely. Remember,
there can be more than one row in your virtual trigger tables. You might
have to play with it to make it work in your scenario.

- MDM

In article <7fq5ko$2kj$1...@nnrp1.dejanews.com>,

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

calber...@hotmail.com

unread,
Apr 24, 1999, 3:00:00 AM4/24/99
to
OK, Morrisom. I'll try it. Thank you.
0 new messages