Go Back   Talk Root - PC Hardware, Software and Web Development forums > System Administration > Database Servers > SQL Server > SQL Server 2



Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
  #1  
Old 03-24-2004, 05:59 AM
middletree
Guest
 
Posts: n/a
Default FK and replication

We are looking into how to do replication on a SQL Server 2000 db, for
disaster recovery. One thing we found was that FK contraints won't replicate
well. So we decided to drop the FK constraint, then add it back with a bit
of code that says it is not for replication.

We got this idea from someone who is using DB2 or Oracle (I can't remember
which). Will this work on SQL Server as well?

Here's my code (with some table and field names replaced for this post):

ALTER TABLE tablename DROP CONSTRAINT FKwhatever
ALTER TABLE tablename
ADD CONSTRAINT FKwhatever
FOREIGN KEY (REGIONID)
REFERENCES whatever NOT FOR REPLICATION


Reply With Quote
Reply

Bookmarks
Sponsored Links
FatCow $88 Plan for $66 only Host Unlimited Domains on 1 Account Professional Hosting from Just Host


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On



All times are GMT -7. The time now is 10:55 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
© 2008 TalkRoot.com