Hi,
is it possible that if you have inside procedure dynamic sql, for quick example:
CREATE PROCEDURE dbo.myProcedure @ln varchar(15) WITH RECOMPILE AS DECLARE @ExecStr nvarchar(4000) SELECT @ExecStr = 'SELECT...' EXEC sp_executesql @ExecStr, N'@lastname varchar(15)', @ln
and you call this procedure, dynamic sql still takes plan from the cache, even SP has forced recompile?
When this would happen?
Then I should explicitly include recompile hint into sp_executesql?
I couldn't find an example, but some people claim that it is possible.
br, Simon