Stored procedure takes longer to run than query.
Issue: Hi I have a stored procedure and when i run it by using declare and set parameter it gives me result with in 30 seconds but if I use (exec sp_procedurename parametervalue1,parametervalue2) statement then it takes 5 minutes to execute. Resolution: If you’re running the same exact SQL as the stored procedure and the... » read more