troubleshooting Question

SQL Date Parameter decrease script performance in stored procedure

Avatar of Yeaktom
YeaktomFlag for South Africa asked on
SQL
5 Comments1 Solution17 ViewsLast Modified:
Good day.

I have narrowed down the issue of my previous post from yesterday. I have created multiple views and created a stored procedure which have 2 paramaters. A date and costcentre field. I have noted that if i fix the date value in the script it will run in 20 seconds. However the moment i add the date parameter and execute the proc it takes forever to run. I have tried casting this field as date and datetime with no effect. In the db the date field is a date data type.

What else can i try to increase the performance to where i fixed the date field to a actual value in the stored procedure

Regards
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros