Viewing 5 posts - 1 through 5 (of 5 total)
Paul's Suggestion
CREATE NONCLUSTERED INDEX [UQ dbo.TransactionDetail TransactionId (AccountId, Direction, Amount)]
ON [dbo].[TransactionDetail] (TransactionId ASC)
INCLUDE (AccountId, Direction, Amount)
WITH (SORT_IN_TEMPDB = ON, MAXDOP = 1, ONLINE = OFF);
but i removed the UNIQUE from...
November 10, 2009 at 7:34 am
Thanks alot it works... now it retrieves the 5200 records in only one second...
thanks alot again i appreciate that alot
but please may i ask about the tools you used??
November 10, 2009 at 6:47 am
When i removed the Order By clause the time decreased from "1 minute and 48 seconds" to "2 seconds only".....but i really need this Order By Clause
November 10, 2009 at 2:37 am
attached the updated plan and a txt file that Contains : the 4 tables creation, the stored proc. and the function i used in the stored proc.
November 10, 2009 at 2:22 am
Here Is My SQL Query :
ALTER PROCEDURE [dbo].[usp_rpt_AccountStatement]
@dateFrom smalldatetime = null,
@dateTo smalldatetime = null,
@AccountNum nvarchar(20) = null,
@ComponentNumber nvarchar(20) = NULL
AS
BEGIN
SET NOCOUNT OFF;
CREATE TABLE #Accounts (AccountNumber nvarchar(20))
DECLARE @ISLEAF...
November 9, 2009 at 10:09 am
Viewing 5 posts - 1 through 5 (of 5 total)