SQL2000: Unable to insert into repliacted table

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi NG

We have a Merge replication (SQL2000). For no apparent reason, inserts into
the replicated tables have suddenly stopped working. I have done a DBCC
REINDEX on all the tables/indexes, with no change. Tables contain approx 12
million records. All PK and FK fields are uniqueidentifiers.


The insert statements are in the following format. (dbo.Table2 is the
replicated table)

insert dbo.Table2 ([RecordID], [Field2], [Field3])
select t1.[RecordID], t1.[Field2], t1.[Field3]
from dbo.Table1 t1
left join dbo.Table2 t2 on t2.[RecordID]=t1.[RecordID]
where t2.[RecordID] is null


I have set up dummy data so that the select only returns 1 record. This is
done in under 1 second. If I run the above statement in QueryAnalyser, I
give up and cancel the insert after 3 hours.

However, a modified (2 phase) insert succeeds (± 40 seconds).

select t1.[RecordID], t1.[Field2], t1.[Field3]
into #Tmp
from dbo.Table1 t1
left join dbo.Table2 t2 on t2.[RecordID]=t1.[RecordID]
where t2.[RecordID] is null

insert dbo.Table2 ([RecordID], [Field2], [Field3])
select [RecordID], [Field2], [Field3]
from #Tmp


Any insights into the issue would be appreciated.
Des Norton


.



Relevant Pages

  • Re: Rebuilding Indexes and Replication (SQL 2000)
    ... But doesn't DBCC REINDEX only lock the tables being ... If I don't reindex replicated tables...then those tables ... (recommended sql server 2000 replication book: ...
    (microsoft.public.sqlserver.replication)
  • Re: DFS & FRS
    ... files you need to declare some filter such as *.foo. ... been ignored by FRS previously so there is no record of them; ... If the only missing data is *.tmp, *.bak and ~* files, ... > individule targets have those files set for replication ...
    (microsoft.public.windows.file_system)
  • Re: SQL 2005 --> Replicate Production DB to Development DB
    ... We are using push replication so it looks like I will have to execute the ... But I am having problems with the 'DBCC CHECIDENT' command. ... Consider the following .pre file generated from the snapshot agent ...
    (microsoft.public.sqlserver.replication)
  • Re: SQL 2005 --> Replicate Production DB to Development DB
    ... snapshot and remove all your subscriber data once the snapshot has been ... As part of this replication the contents of the development ... SQL2005 SP2 fixes a DBCC CHECKIDENT bug with the exact symtoms that you ...
    (microsoft.public.sqlserver.replication)
  • Re: SQL 2005 --> Replicate Production DB to Development DB
    ... snapshot and remove all your subscriber data once the snapshot has been ... As part of this replication the contents of the development ... process the inserted rows in the development database table are removed. ... SQL2005 SP2 fixes a DBCC CHECKIDENT bug with the exact symtoms that you ...
    (microsoft.public.sqlserver.replication)