LINQ-to-SQL CompiledQuery.Compile() with Update, Delete, Insert?

后端 未结 3 817
野性不改
野性不改 2020-12-19 06:25

All,

So I\'ve got all my select queries in LINQ-to-SQL converted to using CompiledQueries to speed things up. Works great so far for select statements, but I haven\

3条回答
  •  失恋的感觉
    2020-12-19 07:10

    L2S uses "sp_executeSQL" so after you run it the first time it will be in the stored procedure execution plan cache. Subsequent runs (of the same query - not same params) will reuse the compiled plan from the cache. So what you are asking for is automagically handled by SQL Server 'behind the scenes'.

提交回复
热议问题