I am attempting to run a query against my database using Dapper, however, an exception is being thrown. The message of the exception is
Incorrect syntax near ')'
The part of this that is confusing to me is that I have no right parens in my entire query. It used to have some, but I have been simplifying it until I got to this:
select i.id as EmployeeReviewId
from @ReviewIds i
Which still causes the error.
@ReviewIds is a table-valued-parameter that only has one column, an int column named id.
I am calling the function like this:
await connection.QueryAsync<FooInfo>(sql, new { reviewIds });
where FooInfo is an object that has an EmployeeReviewId property, and reviewIds is an enumerable of int.
I have to assume that this is something to do with how I am using Dapper.
Would anyone know how to fix this issue?