I have a stored proc which has the input param as integer_list_tbltype. I can run the proc like this
DECLARE @mylist integer_list_tbltype
INSERT @mylist(n) VALUES(1),(2),(3),(4)
exec <Proc_Name> @mylist
When I try to add this under SSRS (Sql reporting services 2008) as shared database, then I get error.
Operand type clash: nvarchar is incompatible with integer_list_tbltype
Any workaround for this ?
Ved
I’ve been frustrated by the same issue recently. I think this happens because SSRS always sends every parameter as nvarchar when actually invoking the queries that the report needs to run. There’s no way that SQL Server will correctly interpret an nvarchar as the table type that you’re trying to use, so you get that error.
I just blogged about a potential solution/workaround where you use a custom code block to populate the table variable before invoking the stored procedure:
http://geekswithblogs.net/GruffCode/archive/2012/06/21/using-table-valued-parameters-with-sql-server-reporting-services.aspx