|
Posted by Hugo Kornelis on 10/01/05 23:04
On Fri, 30 Sep 2005 06:17:33 GMT, Driesen via SQLMonster.com wrote:
>Hi guys
>
>I having trouble with this sproc. I get the following error when testing:
>
>Server: Msg 245, Level 16, State 1, Procedure UTL_CompletenessCheckLoan, Line
>231
>Syntax error converting the varchar value 'danwet w125 ' to a column of data
>type int.
>
>I have declared @Sellername as Varchar. Please can someone tell me what I'm
>doing wrong? All it needs to do is return the 'Y' value if there are numerics
>in the sellername.
>
>declare @sellername varchar(40),
> @applicationid INT
>
> select @sellername = sellername from Seller where ApplicationId =
>@ApplicationId
> If @sellername is not null or @sellername <> ''
> begin
>
>if (select isnumeric(Sellername) from seller where ApplicationId =
>@ApplicationId) = 1
> select 'Y'
>ELSE
> select 'N'
> end
>
>
>Thanks for any help
>Driesen
Hi Driesen,
In this code snippet, I see only one snippet that MIGHT cause this
error: if the column Seller.ApplicationId is not numeric, and stores the
value 'danwet w125 ' in one of the rows, you'd get this error when
executing the (first) SELECT statement. But I also note that the error
is reported at line 231, and you only posted about 10 lines. Maybe you
should repost the complete procedure?
Another thing: why don't you replace the select in the IF statement with
the variable you just retrieved in the previous statement?
IF ISNUMERIC(@sellername) = 1
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)
[Back to original message]
|