June 14, 2013 at 7:34 am
My problem is that i am having a stored proc that takes too long to run. I have linked servers configured and when i run the proc from server2 it takes over 20 seconds and does a 'REMOTE SCAN' in the execution plan.
The stored proc is:
CREATE PROCEDURE dbo.SP_MyProc
@user-id uniqueidentifier,
@ServiceID int
AS
BEGIN
UPDATE TABLEA
SET Comment = @SERVICEID
WHERE UserID = @userid
end
When i run this code as simple inline update statement on both servers such as:
UPDATE [server2].DatabaseA.TableA
SET Comment = '237'
WHERE UserID = '6FE30BDA-A38B-4D0D-B10F-DC0D324E7883'
it runs in under 1 second but when i call the SP it takes over 20 seconds and this is causing time outs.
Can anybody advise as to why when i run it as the simple inline UPDATE it works fine but not so when i call the SP ?
June 14, 2013 at 9:18 am
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply