Multiplevel parameter using Splitlist error

in my stored procedure i use splitlist.  but for some multiple selections it gives result. but if clicks select all it gives  error INVALID LENGTH PARAMETER  PASSED TO LEFT or SUBSTRING FUNCTION.

and (itemgroupid in (SELECT FieldName FROM SplitList(@itemgroupid,',')) and  (salesoriginid in (SELECT FieldName FROM SplitList(@salesoriginid,',')) and (CustomerCode in (SELECT FieldName FROM SplitList(@Cust,','))
and (dimension2_ in (SELECT FieldName FROM SplitList(@CC,','))
and (dimension3_ in (SELECT FieldName FROM SplitList(@Purpose,','))
AnnaJames77Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Imran Javed ZiaConnect With a Mentor Consultant Software Engineer - .NET ArchitectCommented:
It seems,  you are passing null or empty string, or make sure your parameter data is not ending or starting with "," comma.
Thanks
0
 
EmenizerConnect With a Mentor Commented:
Check this post on problems with this function: http://www.tek-tips.com/viewthread.cfm?qid=1563833&page=1
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.