Quantcast
Viewing all articles
Browse latest Browse all 10045

errors when parsing multiple values in a dataset

I got this error when I parse multiple data to sql server for a report.  This error happens when I put the data line by line, if I manully separate the data by comma, it works fine. Here is my query which works fine in query designer.

DECLARE @sql varchar(1000) 

BEGIN

SET    @sql = 'Select pn_id,Count(pn_id)as Number  
       from dbo.pen_link_component
       where pn_id in ('+@userid+') and invitemlk_ky= 503569 
       Group by pn_id'
END 
EXECUTE (@sql)
Image may be NSFW.
Clik here to view.


Viewing all articles
Browse latest Browse all 10045

Trending Articles