Monday, March 19, 2012
how to add table and all its index for replication
calls, the stored procedures you need are:
exec sp_addarticle
exec sp_addsubscription or exec sp_refreshsubscriptions
I can script mine out for you and post them up, but it
would be more useful for you to create a dummy
publication and add the new articles using enterprise
manager. After they're created, right click the
publication and get EM to script out the publications.
Selecting the relevant sp_addarticle sp_and
addsubscription bits will give you what you need.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
I guess i can try it out.. Are indexes added thru sp_addarticle ? or is
there a parameter in there that states to includes indexes,
constraints,etc..?
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:0faf01c4f6f9$292fbae0$a501280a@.phx.gbl...
> If you're talking about code as in stored procedure
> calls, the stored procedures you need are:
> exec sp_addarticle
> exec sp_addsubscription or exec sp_refreshsubscriptions
> I can script mine out for you and post them up, but it
> would be more useful for you to create a dummy
> publication and add the new articles using enterprise
> manager. After they're created, right click the
> publication and get EM to script out the publications.
> Selecting the relevant sp_addarticle sp_and
> addsubscription bits will give you what you need.
> Rgds,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||Have a look at @.schema_option in sp_addarticle. If you
select teh elipsis button in EM and on the article
properties, snapshot tab, you'll see the corresponding
checkboxes. The easiest thing to do is to select what you
want graphically, and then have EM do the bitmask logic
to generate the correct parameter value.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
Wednesday, March 7, 2012
How to Add a Missing Index to a Table in Merge Replication?
index. Strangely, only the table in one of the subscriber of the merge
replication is missing the index; another subscriber and the publisher
of the merge replication don't have this problem.
How should I add the missing index back to that table? My understanding
is that making structural change on a table that is in
merge-replication is different from making change on a table that is
not merge-replicated. For example, when we need to add a column into a
table that is being merge-replicated, we must add the column by
changing the attributes in the properties of the published article
(table) instead of simply using CREATE INDEX command. I am wondering
whether there is a similar restriction on adding an index onto a table
that is merge replicated.
I have already added the index back to the table anyway. I am asking
here just in case doing this may get me into a problem later on.
Thanks in advance for any info.
Jay Chan<jaykchan@.hotmail.com> wrote in message
news:1106577312.674228.283880@.z14g2000cwz.googlegr oups.com...
> One of the table that is in a merge replication somehow is missing an
> index. Strangely, only the table in one of the subscriber of the merge
> replication is missing the index; another subscriber and the publisher
> of the merge replication don't have this problem.
> How should I add the missing index back to that table? My understanding
> is that making structural change on a table that is in
> merge-replication is different from making change on a table that is
> not merge-replicated. For example, when we need to add a column into a
> table that is being merge-replicated, we must add the column by
> changing the attributes in the properties of the published article
> (table) instead of simply using CREATE INDEX command. I am wondering
> whether there is a similar restriction on adding an index onto a table
> that is merge replicated.
> I have already added the index back to the table anyway. I am asking
> here just in case doing this may get me into a problem later on.
> Thanks in advance for any info.
> Jay Chan
I seem to remember that MSSQL only replicates indexes as part of an initial
snapshot, and after that they have to be maintained manually, so what you've
done would be fine. But I must admit that I'm not at all sure about the
details, so you might want to post in microsoft.public.sqlserver.replication
and see if you get a better answer.
Simon|||> I seem to remember that MSSQL only replicates indexes as part of an
initial
> snapshot, and after that they have to be maintained manually, so what
you've
> done would be fine. But I must admit that I'm not at all sure about
the
> details, so you might want to post in
microsoft.public.sqlserver.replication
> and see if you get a better answer.
Thanks for the confirmation. In any case, I cannot find a way to add an
index through the attributes of the replication publication anyway. I
am sure I am on the right track.
Jay Chan|||> I seem to remember that MSSQL only replicates indexes as part of an
initial
> snapshot, and after that they have to be maintained manually, so what
you've
> done would be fine. But I must admit that I'm not at all sure about
the
> details, so you might want to post in
microsoft.public.sqlserver.replication
> and see if you get a better answer.
Thanks for the confirmation. In any case, I cannot find a way to add an
index through the attributes of the replication publication anyway. I
am sure I am on the right track.
Jay Chan