Hi Mike !
How can you verify that "set forceplan on" is used ?? I don't know of any
way to do so. Just because the optimizer actually chooses to join tables in
the from clause in the same order you wrote them down, this doesn't mean
that "set forceplan on" is the reason... ?
<Mike_S> schrieb im Newsbeitrag
> I am trying to use 'set forceplan on' inside a stored procedure.
> I only want to set forceplan on if certain conditions are met.
> I do this:
> If @var = 1 set forceplan on
> Forceplan is always being set on even when @var is not 1.
> Has anyone seen this? The procedure is being executed with recompile so
> should not be using old plan.