All,
I have an expensive scripted view which runs but it takes a very long time to execute (about 30 mins) the same script was placed in a stored procedure and it ran in 3 minutes. I am not sure what would make this big difference. when looking at the execution plan it seems like the stored proc caches the queries in the script and therefore runs much faster. is there a configuration setting that can be applied to the view itself to make this a faster processing from the scripted view to mimic the execution from the stored procedure? what else should I be looking at when creating these db objects. again, the same script was placed on both (scripted view and stored procedure)
thank you in advance