Hmm...So I tried it although I want it to convert the types to varchar since it is a varchar field.Although I still need to change the name of the functions...so I did this:Create Function dbo.CsvToInt ( @Array varchar(1000)) returns @IntTable table (IntValue varchar)ASbegin declare @separator char(1) set @separator = ',' declare @separator_position int declare @array_value varchar(1000) set @array = @array + ',' while patindex('%,%' , @array) <> 0 begin select @separator_position = patindex('%,%' , @array) select @array_value = left(@array, @separator_position - 1) Insert @IntTable Values (Cast(@array_value as varchar)) select @array = stuff(@array, 1, @separator_position, '') end returnend
And inside my stored procedure I have....WHERE ... AND(@WBS IS NULL OR dbo.IssueWBSElements.WBS IN (dbo.CSVToInt(@WBS)))
The stored procedure checks out fine...when i run the report I get:An error has occurred during the report processing.Query execution failed for data set dsIssueActions Invalid object name dbo.CSVToInt.