Allan,
The problem was that in Destination Table,it was defined to be numeric with
precision 3 and I had a number with 10 digits in my source CSV file and I
had to add another condition in my validation stating that if the source is
bigger than 3 ,don't send it for lookup:-)
[quoted text, click to view] >> IF DTSSource("Col002").Value <> "P1" AND
>> IsNumeric(DTSSource("Col002").Value ) AND
>> Len(Cstr(DTSSource("Col002").Value)) < 3 THEN
>> IF DTSLookups("UserLookup").Execute(DTSSource("Col002").Value) > 0
>> THEN
>> Validation =TRUE
>> END IF
>> end if
Thanks Allan for your nice replies.
[quoted text, click to view] "Allan Mitchell" <allan@no-spam.sqldts.com> wrote in message
news:OF4Bw5iIFHA.2420@TK2MSFTNGP14.phx.gbl...
> Have a look at all the values for Col002
>
> Do this in QA
>
> select ISNUMERIC('£')
>
> It returns a 1 whereas this is most definitely not a number.
>
> Allan
>
> "RayAll" <RayAll@microsft.com> wrote in message news:RayAll@microsft.com:
>
>> I am using a simple lookup liske this :
>>
>> SELECT COUNT(USERID) AS countID
>> FROM dbo.user
>> WHERE (IS_ACTIVE = 'Y') AND (USERID= ?)
>>
>> USERID =(numeric(3,0),not null)
>>
>> and I am trying to send it the value through my activex code as this
>>
>> IF DTSSource("Col002").Value <> "P1" AND IsNumeric(
>> DTSSource("Col002").Value ) THEN
>> IF DTSLookups("UserLookup").Execute(DTSSource("Col002").Value) > 0
>> THEN
>> Validation =TRUE
>> END IF
>> end if
>> but I'm getting this error:
>>
>> microsoft ole db provider for sql server invalid character value for cast
>> specification
>>
>>
>> Thanks for your help
>