December 21, 2009 at 3:53 am
Hi,
I have a strange problem happening.
I have a query that if i execute it on SQL Server 2000 or SQL Server 2005 without explicitly write the Begin Transaction and the commit transaction, it wotks fine!
But when i put the Begin Transaction and commit transaction on it, this query executes normal in SQL Server 2005 but in SQL Server 2000 is very, very slow...
Why this appens?
QUERY :
begin transaction
insert into exportacao_diferenca(rgc)
select rgc from dnicentral.dbo.V_SMPN_CONTRIBUINTES
where rgc not in (select rgc from contribuintes )
and rgc not in(select rgc from exportacao_diferenca where id_operacao is null )
insert into contribuintes
select nif,rgc,status,cod_met_tributario,nome,cod_provincia,
cod_municipio , Cod_Rep_Fiscal, dt_inicio, cod_cae
from dnicentral.dbo.V_SMPN_CONTRIBUINTES where rgc in
(select rgc from exportacao_diferenca where id_operacao is null)
insert into act_secundarias
select * from dnicentral.dbo.V_SMPN_ACT_SECUNDARIAS where rgc in
(select rgc from exportacao_diferenca where id_operacao is null)
commit transaction
December 21, 2009 at 6:28 am
Looks like the DTC (Distributed Transaction Coordinator) is not properly configured on the two servers. We've seen this between our PeopleSoft HR and Finance servers as the application uses explicit transactions even on select statements.
What version of the OS are you running on both Servers?
You will need to go into Component Services, Computers, My Computer, Distributed Transaction Coordinator to check/fix on both servers.
December 21, 2009 at 6:29 am
Can you run the update statistics on SQL Server 2000 and execute the query again in sql 2000?
---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply