Can anyone tell me if there is a way to speed up the following stored proc?
INSERT INTO Temp_TrustTransDetail
SELECT fn_TrustTrans.FileNumber, e.trindex, e.trline, e.trdesc, 'nkane'
FROM (fnBP_UniqueFileNumbers() INNER JOIN fn_TrustTrans() ON fnBP_UniqueFileNumbers.FileNumber = fn_TrustTrans.FileNumber)
INNER JOIN elitedb.son_db.dbo.trdesc AS e ON fn_TrustTrans.trindex = e.trindex
ORDER BY fn_TrustTrans.FileNumber, e.trindex, e.trline
The function fn_TrustTrans pulls data from a linked server. The procedure takes about 51 seconds to run.
Thanks
enak
INSERT INTO Temp_TrustTransDetail
SELECT fn_TrustTrans.FileNumber, e.trindex, e.trline, e.trdesc, 'nkane'
FROM (fnBP_UniqueFileNumbers() INNER JOIN fn_TrustTrans() ON fnBP_UniqueFileNumbers.FileNumber = fn_TrustTrans.FileNumber)
INNER JOIN elitedb.son_db.dbo.trdesc AS e ON fn_TrustTrans.trindex = e.trindex
ORDER BY fn_TrustTrans.FileNumber, e.trindex, e.trline
The function fn_TrustTrans pulls data from a linked server. The procedure takes about 51 seconds to run.
Thanks
enak