I have the following but it is not working:
declare @p1 int
exec sp_prepare @handle=@p1 output,@params=N'@id int,@name nvarchar (MAX)',
@stmt=N'SELECT [id],[name] FROM [dbo].[channel] WHERE [name] IN (@name)'
select @p1
exec sp_execute @handle=1,@id=NULL,@name=N'''nisse'',''pelle'''
Is there a way of doing it like above or am I forced to parameterize every value in the array?
I can not use other tables, functions or change the query other than the where
and the @name
parameter.