I have sqlserver 2005 with two linked servers, one Oracle in the same server room and the other Sqlserver 2005 in New York, I am in VA
When I execute the following statement it takes 32 minutes to update the record.
The sub query that pulls the data from oracle takes less than a second, the rest of the time is the single update on sqlserver in NY.
What could possibly cause it to take so long? I've updated this server (not with this statement) thousands of times without this delay.
update p set job1=j1, job2=j2, job3=j3, job4=j4, job5=j5, job6=j6, job7=j7, job8=j8
from orslive.ors.sa.people as p join
(select pid,contid,
sum(case when RowNumber = 1 then job end) as j1,
sum(case when RowNumber = 2 then job end) as j2,
sum(case when RowNumber = 3 then job end) as j3,
sum(case when RowNumber = 4 then job end) as j4,
sum(case when RowNumber = 5 then job end) as j5,
sum(case when RowNumber = 6 then job end) as j6,
sum(case when RowNumber = 7 then job end) as j7,
sum(case when RowNumber = 8 then job end) as j8
from
(SELECT RowNumber = ROW_NUMBER() OVER (ORDER BY c.contid ASC),c.job,c.pid,c.contid
FROM oraprod..SA.PEOPLE_JOBS c where pid = 9730059 and contid = 8990965 )p group by pid,contid) l on p.pid = l.pid and p.contid = l.contid
where p.pid = 9730059 and p.contid = 8990965