Solved

implementing Merge Replication issues --- cannot drop...foreign keys

Posted on 2006-11-15
8
255 Views
Last Modified: 2008-03-06
Hi,
while trying to initialize merge replication (pull) I am getting errors due to the foreign keys--- is there any way to get this to work without errors? This is a semi-urgent matter
(sql2000)

Thanks
0
Comment
Question by:moruda
  • 4
  • 3
8 Comments
 
LVL 9

Expert Comment

by:dduser
Comment Utility
Hi Moruda,

Can you give me exact errors, i believe you are not copying the relavent tables where the Primary Key are stored. If you don't do that at time of insertion of record it would not get the link.

Regards,

dduser
0
 

Author Comment

by:moruda
Comment Utility
is there any way to setup the database on the pull subscriber without applying a script--rather doing it all at once---maybe like downloading a backup or something?
0
 

Author Comment

by:moruda
Comment Utility
exact error is Could not drop object 'dbo.SystemCodes' because it is referenced by a FOREIGN KEY constraint.
0
 
LVL 9

Expert Comment

by:dduser
Comment Utility
I believe you use Transaction/Snaphshot Replication rather then Merge, only problem in this case is only one database would be taken as base to update information.

Regards,

dduser
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:moruda
Comment Utility
let me explain what i did
we have a local database (which has many tables)
we took the local database and made a copy -- uploaded, backup/restore to the web server
not all tables are replicated as many are just for local and not necessary on web
web server is distributor and publisher for merge replication
we now want to merge (pull) from web server
0
 
LVL 9

Expert Comment

by:dduser
Comment Utility
OK so that means your web server is the primary database where you will have all data. I suggest you create a Transaction Replication instead of Merge Replication.

Regards,

dduser
0
 

Author Comment

by:moruda
Comment Utility
we need merge-- the data will be going both ways...only some tables are specific to the local system and were not included with the replication setup.
0
 
LVL 28

Accepted Solution

by:
imran_fast earned 500 total points
Comment Utility
Hi moruda,

When ever you are configuring replication change the defination for all foreign keys to Not for replication.
becasue may be the data for child table get replicated before the parent table. so the foreing keys will remain there but will not be considered when data is replicated.

Regards

Imran
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
The duplicate key value is (<NULL>) 14 43
t-sql month question 8 40
SQL Connection (Error 18456) 14 29
Report Builder 9 24
Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now