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
Loading
anil johnPosted Jan 5, 2015, 8:15 AM
Vithal WadjePosted Jan 2, 2015, 11:12 AM
Murugesh PPosted Jan 2, 2015, 8:29 AM
Piyush PansuriyaPosted Jan 1, 2015, 8:56 AM
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.