Solved

Multiplevel parameter using Splitlist error

Posted on 2011-03-23
2
611 Views
Last Modified: 2012-05-11
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,','))
0
Comment
Question by:AnnaJames77
2 Comments
 
LVL 16

Accepted Solution

by:
Imran Javed Zia earned 250 total points
ID: 35196911
It seems,  you are passing null or empty string, or make sure your parameter data is not ending or starting with "," comma.
Thanks
0
 
LVL 3

Assisted Solution

by:Emenizer
Emenizer earned 250 total points
ID: 35196919
Check this post on problems with this function: http://www.tek-tips.com/viewthread.cfm?qid=1563833&page=1
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Help with SQL Query 23 39
Database Containment - Benefits 6 26
T-SQL Using IN with a subquery 3 13
Syntax using Declare 3 16
Introduction Earlier I wrote an article about the new lookup functions (http://www.experts-exchange.com/A_3433.html) that ship with SQL Server 2008 R2.  In this article I’m going to show you another new feature of SSRS 2008 R2, this time in the vis…
A recent questions about how to add SSRS named instances, couldn't find any that talks about SQL server 2008, anyway I decided to help by creating some screen shots. The installation is straightforward, you just pop the SQL server 2008 installati…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now