|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by beaconlightboy in MS SQL Server, .Net Editors & IDEs
I have an application that i wrote in vb.net 2005. The application uses a sql server 7 backend. The sql server is running fine. I can't find any issues with processor, hard drive i/o's or anything that would make me believe hardware is the problem. Also note that all the other applications running on the server respond well to queries. The problem is that for some reason all my queries are slow to respond. Even if i run the stored procedures from the query manager they still take just as long. The interesting thing is that these stored procedures are not anything complex. We have similiar ones in our other databases on the same server.
any ideas? I have attached a stored procedure that takes 60 seconds to run. The tables are not big, i am wondering if a database option is set funky?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
|
CREATE PROCEDURE dbo.stp_GetBatchesWithOpenInvoices
/*
Returns all Batches that have at least one invoice that InvInvoiced = False
*/
AS
SET NOCOUNT ON
SELECT TBL_Batches.BatchID, TBL_Batches.BatchName
FROM TBL_Batches INNER JOIN
TBL_Invoices ON TBL_Batches.BatchID = TBL_Invoices.BatchId
WHERE (TBL_Invoices.InvInvoiced = 0) AND (TBL_Batches.BatchPosted = 1)
GROUP BY TBL_Batches.BatchID, TBL_Batches.BatchName
ORDER BY TBL_Batches.BatchID DESC
SET NOCOUNT OFF
RETURN
GO
|
20091118-EE-VQP-93 - Hierarchy / EE_QW_3_20080625