I have a sproc that was taking far more time than I expected.
I pulled out the SQL and ran it with just DECLARED variables for the parameters. It ran nearly instantaneously (versus a reliable 8 seconds with the sproc). This is the same SQL on same machine, returning the same data.
How can I figure out and fix what is causing the sproc to be slow?
This is on SQL Server Express.
Thanks much.