Groups | Blog | Home
all groups > sql server dts > march 2005 >

sql server dts : microsoft ole db provider for sql server invalid character value for cast specification


RayAll
3/5/2005 1:31:09 PM
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




Allan Mitchell
3/6/2005 9:30:12 AM
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

[quoted text, click to view]
RayAll
3/6/2005 11:58:09 AM
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]


Thanks Allan for your nice replies.




[quoted text, click to view]

AddThis Social Bookmark Button