Hi,
When I execute an insert into a table in Analyzer, along the lines of this:
Everything's hunkydory, and the insert is successful.
If I take the same code, and stick the insert in a sproc, I get a syntax error when it tries to convert the bill_qty value to an integer, like I'm asking it to convert non-numeric characters. Well, we both know this isn't the case, as the SQL variant of the code ran through okay.
What's the stored procedure really complaining about?
When I execute an insert into a table in Analyzer, along the lines of this:
Code:
SELECT
cast(Sales_Org_ID as smallint),
sales_org,
pl2_classid,
pl2_class,
convert(decimal(18,1),right(fquarter,4) + '.' + left(fquarter,1)),
(
case when convert(int,round("fweek",1)) >= 10
then convert(decimal(18,2),right(fweek,4) + '.' + left(fweek,2))
else convert(decimal(18,2),right(fweek,4) + '.0' + left(fweek,1))
end
),
convert(int,replace("bill_qty",',',''))...
If I take the same code, and stick the insert in a sproc, I get a syntax error when it tries to convert the bill_qty value to an integer, like I'm asking it to convert non-numeric characters. Well, we both know this isn't the case, as the SQL variant of the code ran through okay.
What's the stored procedure really complaining about?