Yup i still have the same issue
if i run the SP like
Exec SP_NAME parameter_value with recompile
the SP run fine and uses the good execution plan
if i run it with
Exec SP_NAME parameter_value
it uses the poor execution plan
If i add the option to recompile within the SP and execute
Exec SP_NAME parameter_value
then i still get the poor execution plan :w00t:
Done a few changes to the SP to use local variables to try stop any parameter sniffing, no joy, tired the option (optimize for Unknown ) and still no joy 🙁
***The first step is always the hardest *******