|
Perhaps I should make the consequences of this behavior clear.
Because of the statement with hardcoded values, every parameter will create a new statement which must be parsed from the database engine. This increases the database load and my cause different execution plans.
The main problem I have with it is a problem with the query statistics. For every new numeric parameter you get a new query string. A new query string means a new entry in the query statistics. This is a memory leak. A long running background process had more than 100000 queries in the query statistics. That was a memory problem.
|