Skip to content

Feature: Generate Parameterized SQL #184

@sspekinc

Description

@sspekinc

Dynamically generated SQL contains inline constants, which causes SQL Server to compile the query plan every time a new constant is provided for the same query. Compilation is a costly operation and it can be avoided if the generated SQL is parameterized.

Expression.Constant calls can be replaced by a "wrapped" constant as explained in the article below so that the generated SQL is parameterized and the query plan will be cached by the SQL Server.

https://github.com/graeme-hill/gblog/blob/master/source_content/articles/2014.139_entity-framework-dynamic-queries-and-parameterization.mkd

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions