At the end of the statement add Add OPTION (RECOMPILE) to the end
https://stackoverflow.com/questions/10933366/sp-executesql-is-slow-with-parameters
At the end of the statement add Add OPTION (RECOMPILE) to the end
https://stackoverflow.com/questions/10933366/sp-executesql-is-slow-with-parameters