Posted by meendar on 05/02/07 04:51
Hi,
I have selected a field name and declared it as varchar, since it is
varchar in table and performed some numeric operation with numbers,
even after i cast the sql in below code, it throws an exception as
"Error converting data type varchar to numeric."
code:
CREATE PROCEDURE x1 (@y1 AS numeric=NULL )AS
declare @z1 Varchar(200)
begin
set @z1= 'and a1.id='
print @y1
print @z1
end
Declare r1 cursor
local Scroll Keyset Optimistic
For
select z1 from employee a1 where z2= @z1 + 45 .....
I want to clear that how can we cast the field with varchar for
numeric operations, i have also tried cast and convert to change it
but all in vain.
Thanks in Advance!
[Back to original message]
|