all groups > sql server replication > august 2005 >
You're in the

sql server replication

group:

Snapshot Repl. Failing with Foreign Key Constraints



Snapshot Repl. Failing with Foreign Key Constraints Urbankhaos
8/30/2005 2:03:02 AM
sql server replication: Hi Guys,

I wondered if you would be able to assist on this one....?

I have a server with several publications, all going to databases on one
subscriber at a remote site. Some of the DBs work fine with snapshot
replication and need no further attention. However, several of the DBs fail
out with the following error:

3726: Could not drop object "TBL NAME" because it is referenced by a foreign
key constraint.

In the publication properties, articles tab, I have set the article defaults
for the tables NOT to Include declared referential integrity and have changed
the name conflicts to delete all data in the existing table. (I changed from
DROP the existing table and recreate it). When I do this I get the following:

4712: Cannot truncate table "TBL NAME" because it is being referenced by a
foreign key constraint.

I have been chasing my tail on this for a while now and am gradually getting
dizzy in the process!!!!

Any help you could offer would be very much appreciated....

Cheers,

Ian.

Re: Snapshot Repl. Failing with Foreign Key Constraints Urbankhaos
8/30/2005 5:01:03 AM
HIlary,

Thanks for your reply!

I have carried out the actions you prescribed and have specified all tables
to keep the table unchanged. As this repl. includes stored proc. I am now
faced with the following:

3724: Cannot drop the procedure "sp name" because it is being used for
replication.

I have tried to specify that the stored procs are kept and receive the
following:

213: Insert Error: Column name or number of supplied values does not match
table definition

Any ideas?

Ian.



[quoted text, click to view]
Re: Snapshot Repl. Failing with Foreign Key Constraints Hilary Cotter
8/30/2005 6:28:45 AM
When you are specifying your articles, click on the browse button to the
right of your table. In the snapshot tab, ensure that you are selecting the
option keep existing table unchanged or delete all the data in the table
options in the name conflicts portion.

--
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
[quoted text, click to view]

AddThis Social Bookmark Button