I have a stored procedure that unions 3 select statements and is passed a couple of variables to filter the queries.
When I run the stored Proc it takes over a minute. If I cut and paste the exact SQL in to Query Analizer it runs in under 2 seconds.
I tried adding WITH RECOMPILE to the SP which seemed to fix the problem but now it is back
Any suggestions
When I run the stored Proc it takes over a minute. If I cut and paste the exact SQL in to Query Analizer it runs in under 2 seconds.
I tried adding WITH RECOMPILE to the SP which seemed to fix the problem but now it is back
Any suggestions