Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 vachar

Author  Topic 

Saeed
Starting Member

39 Posts

Posted - 2002-07-09 : 17:05:33
Hi ;
I have passed an string (varchar) to my RPC script but during execution it pops up with syntax error converting varchar value '205,203' to a column of data type int.

select * where
(PressN in (@PressMulti)) and DamageCode < 92

PressN is int but i m passing an string to RPC in @pressMulti which is what i suspect is causing the error...

What is the remedy ?

joshb
Yak Posting Veteran

52 Posts

Posted - 2002-07-09 : 17:23:14
I suspect the conversion error is due to the comma in the string. Try eliminating the comma.

Go to Top of Page

Saeed
Starting Member

39 Posts

Posted - 2002-07-09 : 17:40:12

The comma has to be there as the delimiter.
the problem is i m trying to do this
select *from mytable where
age in ('24,34,87')


whereas it should be
select *from mytable where
age in (24,34,87)


now the question is how do i get rid of the damn single quotes as i m passing that '24,34,87' as a varchar to the stored procedure.?




Go to Top of Page

joshb
Yak Posting Veteran

52 Posts

Posted - 2002-07-09 : 17:59:00
Sorry, didn't read the question right.

I think something like this should work:

REPLACE(@VC, '''', '')

@VC being the varchar value you need to strip the single quotes away from.

Go to Top of Page
   

- Advertisement -