>For the parameter's sniffing problem I recommend adding OPTION (RECOMPILE) to the end of the query.
>
>I think there will be a risk factor if you try to embed parameters directly into a string to execute.
Ok, I will check that out and provide a new updated command and we will be able to discuss about it.