Dear Sir,
Can i get a solution for my problem described below ?
I have a stored procedure with a select query like
Select custcode,mob from tableCustomer where custcode in (@custcode)
here @custcode declared as varchar(50)
from a vb.net page am calling this procedure with parameter strCode with value as
'101','102' but not getting the result
when directly executing the query with these custcodes in sql am getting the results
I have a stored procedure with a select query
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Piyush PansuriyaRank #454 · 5.5K reputationPosted Jan 1, 2015, 3:56 AM EST
As per your problem, you have to use string query in storeprocedure like this:
BEGIN
DECLARE @Full_Query NVARCHAR(Max)
SET @Full_Query= 'Select custcode,mob from tableCustomer where custcode in ('+@custcode+')'
EXEC(@Full_Query)
END
Now pass value in parameter like '101,102' from vb.net.
Murugesh P85 reputationPosted Jan 2, 2015, 3:29 AM EST
Vithal WadjeRank #19 · 47.2K reputationPosted Jan 2, 2015, 6:12 AM EST
anil john153 reputationPosted Jan 5, 2015, 3:15 AM EST