all groups > sql server reporting services > july 2005 >
You're in the

sql server reporting services

group:

Multi value string parameters


Multi value string parameters deepu_t NO[at]SPAM hotmail.com
7/31/2005 10:25:28 PM
sql server reporting services: Hi all

I have a multi value drop down list and their values are a string data
type.

Label Value
Blue BL
Pink PK

If I select more than one values the parameter value is sent as 'BL,
PK'

The stored procedure has a where clause

WHERE theColor IN (@SelectedColor)

This does'nt return the expected results from the stored procedure.
How do we make the reporting services pass 'BL','PK' instead of 'BL,
PK' to the stored procedure?
How do I make this work??

Thanks heaps!!
Re: Multi value string parameters goodman93
8/1/2005 8:31:45 AM
Try creating this function:

CREATE FUNCTION ParamsToTable( @delimString varchar(255) )
RETURNS @paramtable TABLE ( Id int ) AS

BEGIN
DECLARE @len int,@index int,@nextindex int
SET @len = DATALENGTH(@delimString)
SET @index = 0
SET @nextindex = 0

WHILE (@len > @index )
BEGIN
SET @nextindex = CHARINDEX(';', @delimString, @index)
if (@nextindex = 0 ) SET @nextindex = @len + 2
INSERT @paramtable
SELECT SUBSTRING( @delimString, @index, @nextindex - @index )
SET @index = @nextindex + 1
END
RETURN
END
GO

And then use this in a join statment.

Select * from table
join ParamsToTable(',', @SelectedColor)



[quoted text, click to view]

Re: Multi value string parameters deepu_t NO[at]SPAM hotmail.com
8/1/2005 4:21:35 PM
Thanks for your reply.

Where do i write the statements
[quoted text, click to view]

Would this be in the stored procedure?
Thanks again!!

[quoted text, click to view]
Re:Multi value string parameters Jack Truneh
11/30/2005 1:16:16 PM
Help!!! ,this works, but if i am accepting multivalue parameters from Asp.
net UI ,parameters are correctly initialized with the values(string[]) but
AddThis Social Bookmark Button