Hello, I have a SP which goes to long run by adding a OR statement in the where clause. Can someone help as how to resolve this?
Oct 27, 2017 at 08:24 AM
Can you post the execution plan? Also, you've tagged SQL 2008 & 2005. Which is it?
I've seen in the past cases where an "OR" can be replaced by two queries that are UNIONed together, with much improved performance... Just a thought.
But, yeah, what @JohnM says - execution plan please!
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
Once you sign in you will be able to subscribe for any updates here
Answers and Comments
Need long-form SQL discussion? SQLserverCentral.com is the place.
asked: Oct 27, 2017 at 08:24 AM
Seen: 60 times
Last Updated: Oct 30, 2017 at 10:05 AM
csv data to separate columns
Dynamic sql query to convert single column string delimited with semicolon (;) to multiple columns
Finding duplicates in a table
Queries returning different results
we only want to see id, who, either before, or CURRENT in the year 2005,
DBCC Check DB issue Please Help
Import multiple excel 2010 files to SQL 2008 r2
How to subtract 2 rows based on min and max dates?
Why Stored Procedure cannot be used with Select, Where & Having. Understand function can serve the purpose. Why SP cannot