I have a query that looks something like this:
SELECT TOP 1 * FROM Customers c (NOLOCK) WHERE Key = (mykey)
AND NOT EXISTS (SELECT 0 FROM Invoices i (NOLOCK) WHERE i.key = c.key AND i.Date > GETDATE() )
When I run this inside an (ODBC) application, it times out. When I run it within SSMS, it works fine. That might make you think its an application problem, but the timeout only occurs for one specific customer ... even in the application, it
works fine for all other key values.
Any idea where I can even start looking for a solution to this? Thanks.
View Complete Post