Well, I answered my own question, which I will share here in case it is of use to anyone else.
My situation is that I had a very long list of StudentID's as a multi-valued parameter is SSRS (2008)--so long that it could sometimes exceed the 8000 char limit for using varchar as a datatype in my stored procedure. All I care about here are the StudentID's (parameter value), not their names (parameter label).
I added the following code to the custom code block in Report Properties in SSRS:
Function StrParmToXML(ByVal obj As parameter) As String
Dim strXML as String
Dim i As Integer
strXML = ""
If obj.IsMultiValue then
For i = 0 To obj.count - 1
strXML = strXML & "<M>" & Cstr(obj.Value(i)) & "</M>"
Next
Else
strXML = strXML & "<M>" & Cstr(obj.Value(i)) & "</M>"
End IF
Return strXML
End Function
In the dataset that calls my stored procedure, I invoke this function as an expression for the Student parameter that is passed to the sp:
=Code.StrParmToXML(Parameters!Student)
On the SQL side, I parse the xml parameter to table rows using the following function:
create function [dbo].[fn_xml_to_table] (@parmxml xml) RETURNS TABLE
AS
RETURN
with name_cte as
(
select @parmxml as Names
),
name_parse_rows as
(
select
ltrim(rtrim(Split.a.value('.', 'VARCHAR(100)'))) AS item
from name_cte
CROSS APPLY Names.nodes('/M') Split(a)
) select * from name_parse_rows
I then invoke the function to select all students using the following sql statement:
select
UserID
,StudentName
from v_Students
where UserID IN (select item from dbo.fn_xml_to_table(@xmlUserList_in));
Dan