How do I get a pass through query to accept input parameters? I have no problem using the syntax below in regular SQL queries and it prompts the user for the information, but it isn't liking this in a pass through for some reason.
--Input Parameters
@Value1 varchar(500),
@Value2 varchar(2)
AS
set nocount on
Declare @SQL varchar(500)
Set @SQL = '
SELECT Table.Field1
FROM Table
WHERE ((Table.Field2) in (' +@Value1+ ')) and ((Table.Field3) in ('+@Value2+'))'
Exec (@SQL)
--Input Parameters
@Value1 varchar(500),
@Value2 varchar(2)
AS
set nocount on
Declare @SQL varchar(500)
Set @SQL = '
SELECT Table.Field1
FROM Table
WHERE ((Table.Field2) in (' +@Value1+ ')) and ((Table.Field3) in ('+@Value2+'))'
Exec (@SQL)