Hi All,
I am using the following query which returns 12158 records:
SELECT A.[Product Number (SKU)],A.[Serial Numbers],A.[Sell Through Quantity],A.[Seller - Company Name],C.[Partner Locn ID],
A.[Eclipse ID],A.[MC Eligibility],A.[Seller - Company ID],A.[Trans Date],A.[Trans Doc ID],
B.[Programe ID],B.[Promo Type],B.[Rebate Value]
FROM dbo.FinalOutput A LEFT JOIN dbo.PromoMaster B
ON (B.SKU <> 'ALL' And A.[Product Number (SKU)] = B.SKU Or B.SKU = 'ALL' And A.[Product Line ID] = B.PL)
LEFT JOIN dbo.PARTNER_MST C ON A.[Seller - Company ID] = C.[Partner Pro ID]
WHERE A.[Trans Date]>=B.[Start Date] And A.[Trans Date]<=B.[End Date] AND Charindex(A.[Seller - Company ID],B.[T1 ID])>0
Here, The main issue is its taking too much time(00:02:49 mins) to display the result.
Because of this delay, an error occurs in the application saying
"Query Timeout Expired"
I want to make this query work faster. Can any one please guide me on this issue..
Regards,
Raj