>When I using CONVERT function to convert nvarchar to numeric, I getting error message "Error converting data type nvarchar to numeric".
>I read help, and figured out that it is because there is charachters inside nvarchar variable.
>But is it possible to convert the same variables without errors, but zeros instead? :)
Not sure if this is exactly what you want, but you could use a CASE statement and check if the value is numeric and if so, convert it. Otherwise, throw in a 0.
Ex.
select 'newvalue' = case isnumeric(@var1) when 0 then 0 else cast(@var1 as numeric(10)) end
HTH.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao