Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Other Technologies / Replication / January 2007

Tip: Looking for answers? Try searching our database.

Changing table properties

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David - 25 Jan 2007 15:05 GMT
I have 7 tables that I want to remove the checkbox for "Enforce relationship
for replication".  These tables are all articles in a publication and I want
them to get down to the merge synchronization laptop subscribers.  On a test
system, I unchecked them in EM and the changes took without any errors
(actually I expected to be told I cannot do that on published articles).  I
assume that I can just re-create the snapshot and have the laptops
"reinitialize" at their next synch.  Am I correct or missing anything.
Thanks.

David
Paul Ibison - 25 Jan 2007 16:39 GMT
David,
this is fine, although you might be able to just apply a script on the
subscriber to drop the FKs directly (or through sp_addscriptexec) without
doing the reinitialization.
        Cheers,
            Paul Ibison SQL Server MVP, www.replicationanswers.com .
David - 25 Jan 2007 19:28 GMT
I tried this in a test environment but when I looked at the database on the
laptop it still had the box checked.  Did I miss something?

David

> David,
> this is fine, although you might be able to just apply a script on the
> subscriber to drop the FKs directly (or through sp_addscriptexec) without
> doing the reinitialization.
>         Cheers,
>             Paul Ibison SQL Server MVP, www.replicationanswers.com .
Paul Ibison - 26 Jan 2007 09:54 GMT
David - can you post up the script you were using and I'll take a look.
        Cheers,
            Paul Ibison SQL Server MVP, www.replicationanswers.com .
David - 26 Jan 2007 14:41 GMT
Paul,
I was trying to do it in Enterprise Manager instead of script.  I then went
into the Snapshot Agent and restarted the snapshot agent, which I thought
would pick up the new settings. I then re-initialized the subscription at
the laptop but it didn't pick up the removal of "Enforce relationship for
replication".
Do I need to completely re-create the publication?  If I can do it in a
script then what script do I use to run on the laptops and where can I find
the syntax for changing this relationship property?  Thank you.

David

> David - can you post up the script you were using and I'll take a look.
>         Cheers,
>             Paul Ibison SQL Server MVP, www.replicationanswers.com .
Paul Ibison - 29 Jan 2007 09:40 GMT
Hi David - have answered your other thread below.
        Cheers,
            Paul Ibison SQL Server MVP, www.replicationanswers.com .
David - 26 Jan 2007 17:23 GMT
Also, do I need to run sp_addscriptexec at both the publisher and
subscriber?  I read the BOL and they said you have to be sysadmin to run it
but the laptops are not.  Thanks.

David

> David - can you post up the script you were using and I'll take a look.
>         Cheers,
>             Paul Ibison SQL Server MVP, www.replicationanswers.com .
Paul Ibison - 29 Jan 2007 09:39 GMT
David,

the script is in the form:

ALTER TABLE dbo.yourFKtable
DROP CONSTRAINT yourFKtable1
GO

ALTER TABLE dbo.yourFKtable WITH NOCHECK ADD CONSTRAINT
yourFKtable1 FOREIGN KEY
(
PKColumn
) REFERENCES dbo.YourPKTable
(
pkcolumn
) NOT FOR REPLICATION

GO

You'll need to run this at the publisher to change the publisher tables then
add it to the publication using sp_addscriptexec.

        Cheers,
            Paul Ibison SQL Server MVP, www.replicationanswers.com .
David - 29 Jan 2007 16:28 GMT
Thanks Paul.  Will I have to run sp_addscriptexec at the subscribers also or
will that happen when they synch?
David

> David,
>
[quoted text clipped - 20 lines]
>         Cheers,
>             Paul Ibison SQL Server MVP, www.replicationanswers.com .
Paul Ibison - 29 Jan 2007 17:21 GMT
David - the merge agent will take care of applying it to the subscribers.
Cheers,
Paul Ibison
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.