SSRS Multi parameter - Integer type

Hi

I'm using SSRS 2008 R2, ONe of the input parameters I'm passing is Multi value input parameter.

On db end my stored proc has input param wiht similar name and data type as varchar, while the column as int types

e.g.

Declare @MultiParam varchar(1000) ='1010,102,125'

Column type being integer is creating problem.

For this I tried couple of approaches but couldn't get around

- I get this error

Arithmetic overflow error converting varchar to data type numeric.

sample code

declare @PnNo varchar(2000) = '1010,102,125'
select @pnNo= SUBSTRING(@PnNo,1,LEN(@PnNo)-1)
select @PnNo

select * from F4801_World
where intColumn IN (@PnNo)

September 7th, 2015 12:59pm

If you need to use a stored procedure, then you would need to use a split function. See samples in this thread

Once you have a splitter function, your query will become:

select * from F4801_Word where intColumn in (select cast(Item as Int) from dbo.fnSplit(@pnNo, ','))

 
Free Windows Admin Tool Kit Click here and download it now
September 7th, 2015 2:13pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics