name1 field is is nvarchar(40).
(1)select case when isnumeric(name1) = 1 then
cast(name1 as int) else null end as name
In (1) when name1 is not numeric, name is null and
its type becomes number not string(40).
And,
(2)select case when isnumeric(name1) = 1 then
cast(name1 as int) else name1 end as name
In (2) when name1 is Not numeric it gives error:
can not cast name to int.
Basically, i like to convert name1 to Integer if it is
numeric or keep it in its origianl nvarchar(40) if it
is Not numeric. how?.
--
Sent by 3 from yahoo element from com
This is a spam protected message. Please answer with reference header.
Posted via http://www.usenet-replayer.com