Friday, March 30, 2012
Merge snapshot problem with views and ArticleType property with SQ
tables, views, procs, and UDFs using SQLDMO. I have no problems creating the
publication with tables only. When I try to add procs using the following
code I get the error
The @.schema_option parameter for a procedure or function schema article can
include only the options 0x0000000000000001 or 0x0000000000002000.
I assume I am not setting up the objMrgArt object properly. Any help is
appreciated.
For i = 1 To objRepSps.Count
Set objRepSp = objRepSps(i)
Set objMrgArt = New SQLDMO.MergeArticle2
objMrgArt.Name = objRepSp.Name
objMrgArt.SourceObjectName = objRepSp.Name
objMrgArt.SourceObjectOwner = objRepSp.Owner
objMrgArt.ArticleType = SQLDMORep_ProcSchemaOnly
objMrgPub.MergeArticles.Add objMrgArt
Next i
Since different article types accept different set of schema options (or in
SQLDMO terminology, MergeArticle.CreationScriptOptions) and the (arguably
semi-buggy) SQLDMO behavior of having a set of default CreationScriptOptions
that is not compatible with all article types, you would need to explicitly
specify a compatible set of CreationScriptOptions when creating a non-table
article. Extending the example that you have given below, you can write:
For i = 1 To objRepSps.Count
Set objRepSp = objRepSps(i)
Set objMrgArt = New SQLDMO.MergeArticle2
objMrgArt.Name = objRepSp.Name
objMrgArt.SourceObjectName = objRepSp.Name
objMrgArt.SourceObjectOwner = objRepSp.Owner
objMrgArt.ArticleType = SQLDMORep_ProcSchemaOnly
objMrgArt.CreationScriptOptions =
SQLDMO_CREATIONSCRIPT_TYPE.PrimaryObject Or
SQLDMO_CREATIONSCRIPT_TYPE.ExtendedProperties
objMrgPub.MergeArticles.Add objMrgArt
Next i
To ensure that the base stored procedure and the associated extended
properties are replicated with the initial snapshot.
HTH.
-Raymond
This posting is provided "as is" with no warranties and confers no rights.
"mspradley" <mspradley@.discussions.microsoft.com> wrote in message
news:57624519-68F3-4073-BF90-D2DD80EBCEF3@.microsoft.com...
> I am trying to create a merge publication with a snapshot that includes
all
> tables, views, procs, and UDFs using SQLDMO. I have no problems creating
the
> publication with tables only. When I try to add procs using the following
> code I get the error
> The @.schema_option parameter for a procedure or function schema article
can
> include only the options 0x0000000000000001 or 0x0000000000002000.
> I assume I am not setting up the objMrgArt object properly. Any help is
> appreciated.
>
> For i = 1 To objRepSps.Count
> Set objRepSp = objRepSps(i)
> Set objMrgArt = New SQLDMO.MergeArticle2
> objMrgArt.Name = objRepSp.Name
> objMrgArt.SourceObjectName = objRepSp.Name
> objMrgArt.SourceObjectOwner = objRepSp.Owner
> objMrgArt.ArticleType = SQLDMORep_ProcSchemaOnly
> objMrgPub.MergeArticles.Add objMrgArt
> Next i
>
Merge snapshot frequency
1.merge replication with 3000 subscribers
2.I have dynamic publication (NOT dynamic snapshot)
3.we observed that synchronization is slow whenever we do a data import at
the publisher
4.because of this we ran the snapshot agent immediately after the data import
5.after the snapshot run, we find the subscriber syncs faster
I would like to know what are the implications of running snapshot agent.
Will it remove the delta changes which are pending for sync? Or is it okay if
I run snapshot as much as I like?
Expect slowness whenever you do a data import as there is always the impact
of the dataload and then there is the added data you have to merge.
Are you saying if you run the snapshot you get faster sync's? This only
makes sense if you re-initialize your subscribers after regenerating the
snapshot.
If you have anonymous subscribers the snapshot is always generated each time
you run it. If you have named it is only regenerated if subscribers expire
or require reinitialization.
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
"Ravi Lobo" <RaviLobo@.discussions.microsoft.com> wrote in message
news:45E03380-6DE7-4AB1-B20D-A97C18B04717@.microsoft.com...
>I have the following scenario,
> 1.merge replication with 3000 subscribers
> 2.I have dynamic publication (NOT dynamic snapshot)
> 3.we observed that synchronization is slow whenever we do a data import at
> the publisher
> 4.because of this we ran the snapshot agent immediately after the data
> import
> 5.after the snapshot run, we find the subscriber syncs faster
>
> I would like to know what are the implications of running snapshot agent.
> Will it remove the delta changes which are pending for sync? Or is it okay
> if
> I run snapshot as much as I like?
>
>
|||Thank you Hilary for you time. I have some more clarifications,
1.I have sql server ce subscribers
2.Hence I need to use anonymous subscription
I have the following questions here,
a)Can I use pre-generated snapshot in my case? (Anonymous + sql ce
subscribers)
b)I also have dynamic filters on the publisher. What impact I will have by
re-running the snapshot second time, on the subscriber?
"Hilary Cotter" wrote:
> Expect slowness whenever you do a data import as there is always the impact
> of the dataload and then there is the added data you have to merge.
> Are you saying if you run the snapshot you get faster sync's? This only
> makes sense if you re-initialize your subscribers after regenerating the
> snapshot.
> If you have anonymous subscribers the snapshot is always generated each time
> you run it. If you have named it is only regenerated if subscribers expire
> or require reinitialization.
> --
> 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
>
> "Ravi Lobo" <RaviLobo@.discussions.microsoft.com> wrote in message
> news:45E03380-6DE7-4AB1-B20D-A97C18B04717@.microsoft.com...
>
>
Merge Rpl. Pull from subscriber access denied problem
I have set up one laptop as the Distributer/Publisher. Went through the
wizard and set up a Publication also, used Pubs. Then registered another
remote laptop that I can see via the network, and it can see me. I went
through the wizard again and set up a Push to that laptop. Said it ran good,
and I can see the tables on the remote laptop now.
I deleted the Push and keep trying to create a Pull at the other laptop,
(subscriber). The wizard sets it up, but when it Starts Syncronizing, it
immediately gets the big Red X.
The error said The schema script
'\\ACER\ReplShare\ReplData\unc\ACER_pubs_pubs_arti cles\20050928212317\stores_1.sch' could not be propagated to the subscriber.
I can see this share from both ends. I have read a ton about the accounts
the agent has to run under in the last 12 hours, but can't see what I am
doing wrong.
Is there a trick here?
Thanks.
Steve,
try logging on to the subscriber laptop using the same account that the sql
server agent uses as a service account. The see if you can browse to the
snapshot folder
\\ACER\ReplShare\ReplData\unc\ACER_pubs_pubs_artic les\20050928212317. If you
can, see if you can copy the contents of this directory locally. I'm
guessing that the first part won't be possible due to permission
restrictions, but please post back with your results.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Paul,
I had tried some other things prior to being able to read your response.
Here is what I have done that is now working.
I set up new SQL users on both Publisher/Dist. and Subscriber, giving them
the proper roles. I then set up a new Windows login on each box, "Bob", of
type admin. I then changed both the MSSQLSERVICE and SQLAGENTSERVICE on each
to run under "Bob". When it asks for logon credintials for the subscriber, I
use the sa, when it asks for the publisher, I use the new SQL user I had set
up. Probably may have been able to use that for the subscriber instead of
the sa, don't know.
I have tried so many things since yesterday afternoon, I am a little unsure
as to what actually solved it. From all I read over night, having the two
service run under "Bob" was needed.
Thank you for the response,
Steve
"Paul Ibison" wrote:
> Steve,
> try logging on to the subscriber laptop using the same account that the sql
> server agent uses as a service account. The see if you can browse to the
> snapshot folder
> \\ACER\ReplShare\ReplData\unc\ACER_pubs_pubs_artic les\20050928212317. If you
> can, see if you can copy the contents of this directory locally. I'm
> guessing that the first part won't be possible due to permission
> restrictions, but please post back with your results.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>
|||This is OK - what you've set up is known as pass-through authentication.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Is there a better or more preferred method? We have one laptop that acts as
the publisher/distributor, and two other laptops that will be subscribers.
They run over a wireless network. The two subscribers will be able to
initial pull merge replications.
Thanks,
Steve
"Paul Ibison" wrote:
> This is OK - what you've set up is known as pass-through authentication.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>
|||Steve,
are the laptops all on the same domain? If so, you could use a domain
account, which is given rights to the distributor's working folder. If not,
it's either pass-through, FTP, backup and restore or alternative snapshot
locations.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
sql
Merge reversed
I have a merge publication/subscription (rows are
filtered by location), replicating data between 16
servers (15 remote location & a main office). When data
is changed at the a remote location, the changes gets
propagated to the main office, but at some point, the
change gets reversed.
Any idea what is causing this?
Larry,
when you say it gets reversed, do you mena the row is deleted from the
subscriber? This could be caused if you are partitioning data and a row has
been added on a subscriber which doesn't accord with its filter.
HTH,
Paul Ibison
|||Look in the conflict table, for the article, on the publisher. This might
give you a clue as to what is going on.
Rand
This posting is provided "as is" with no warranties and confers no rights.
|||Paul,
No the row is not deleted, but changed back to its
original state, prior to being updated at the
subscriber. This happens sporadically, but is causing
MAJOR problems.
Larry...
|||Rand,
There is nothing in the conflict tables for any article
in the publication.
Larry...
|||I saw your reply to Rand and if both filtering and conflicts are ruled out
(and no user on the publisher is altering the data!) then this is very
strange. I'd use profiler or an audit trigger to capture what is going on.
HTH,
Paul Ibison
|||Thanks Paul...will do.
|||Does the MSmerge_history table on the distributor offer any reason why
the updates were not applied?
Reinout Hillmann
SQL Server Product Unit
This posting is provided "AS IS" with no warranties, and confers no rights.
anonymous@.discussions.microsoft.com wrote:
> Rand,
> There is nothing in the conflict tables for any article
> in the publication.
> Larry...
>
Merge Repliction - Run Stored Procedure when merge agent starts
This publication is configured with a number of dynamic filters to
reduce the amount of data sent to each client. Each client has an
anonymous pull subscription. The merge process can be triggered by the
windows sync manager and my application.
To improve performance I have created some helper tables to hold the
mapping between user login and primary keys of selected entities.
For the replicated data to be correct the contents of the helper tables
needs to be up to date.
I need to fire off a stored procedure on the publisher before
replication starts to verify that this data is up to date. I can not
see any documented way of doing this however I have been experimenting
with some unorthodox systems.
Firstly has anyone any ideas?
I have been considering adding a trigger to some of the tables used by
the Microsoft replication code - yes I know this is very nasty.
My problems arise because executing this stored procedure will cause
some data to be updated. In updating data we could create a new
generation in the database. I must therefore run my stored procedure
before any the Microsoft code makes any generation checks / updates.
Anyone done anything similar, Anyone have any better ideas?
Any comments would be gratefully received.(tedd_n_alex@.yahoo.com) writes:
> My problems arise because executing this stored procedure will cause
> some data to be updated. In updating data we could create a new
> generation in the database. I must therefore run my stored procedure
> before any the Microsoft code makes any generation checks / updates.
> Anyone done anything similar, Anyone have any better ideas?
Not being very good at replication, I can only recommend you to visit
microsoft.public.sqlserver.replication. There are some guys that knows
replicataion really well there.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp
Merge Replication: Dropping an article from existing Publication
How to drop a single article (TABLE) from merge replication keeping
publication intact.
Regards
Javed Iqbal
Javed,
unlike transactional, this is not possible. The nearest you can get is to
drop the publication hten recreate it without the article and do a nosync
initialization.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Hi Paul,
Thanks for the help.
Actually I want to change a column width in a replicated table which is
appearing at first position.
I can add dummy column then update dummy column with data. Then drop the
main column. Recreate main column with new size and update it. And finally
removing the dummy column using sp_repladdcolumn and sp_repldropcolumn.
But it will add the column at last position.
Is there any way to redefine column position on a replicated table?
OR
How to add a column at specific position?
Thanks in advance.
Regards
Javed Iqbal
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:ucTtJkYTGHA.4132@.TK2MSFTNGP11.phx.gbl...
> Javed,
> unlike transactional, this is not possible. The nearest you can get is to
> drop the publication hten recreate it without the article and do a nosync
> initialization.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||Javed,
ideally the application is not dependant on the column position. We have no
TSQL to specify it, and the only practical way is to recreate the table. In
terms of merge, this would be a reinitialization. If at all possible, make
your application use column names rather than position numbers. As an
interim measure can you perhaps define a view?
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thanks Paul for your prompt help.
Ideally my TSQL should refer column names but in my applications I am not
sure about what programmers have coded in TSQL. And it is not possible to
check those programs

There are many reports based on this table hence I do not want to play with
the column position.
Correct me if I wrong at following.
Scenario - Merge Replication with NOSYNC.
I have only option to drop subscription / publication and recreate it with
the earlier generated scripts.
Regards
Javed Iqbal
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:%23x2oERZTGHA.1160@.TK2MSFTNGP09.phx.gbl...
> Javed,
> ideally the application is not dependant on the column position. We have
no
> TSQL to specify it, and the only practical way is to recreate the table.
In
> terms of merge, this would be a reinitialization. If at all possible, make
> your application use column names rather than position numbers. As an
> interim measure can you perhaps define a view?
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||Javed,
a nosync initialization would be ok. You could change the column position on
the publisher and subscriber before synchronising. In this case you'd take
over control of the identity range management. You could only use the
previous scripts if they were themselves defined as nosync.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Yes Paul,
I am using NOSYNC since MERGE Replication is created / started.
Identities are ODD on Publisher EVEN on subscriber.
Any further inputs are highly appreciated.
Thanks a lot again Paul.
Regards
Javed Iqbal
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:ecN9afZTGHA.6084@.TK2MSFTNGP14.phx.gbl...
> Javed,
> a nosync initialization would be ok. You could change the column position
on
> the publisher and subscriber before synchronising. In this case you'd take
> over control of the identity range management. You could only use the
> previous scripts if they were themselves defined as nosync.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>
>
Wednesday, March 28, 2012
Merge replication, Identity not for replication, identity range
When setting up a (merge) publication using the wizard, you can click
the three-dotted button in the "specify articles" and then setup the
identity range for publisher and subscribers.
While this is an interesting option, I see that the default is not
checked (yes, I have the identity column setup as not for replication).
Now my database only has about 50 tables but nevertheless, not my
favorit waste of time to call up each table one by one and adjust these
values one by one (tabbing to the correct tab, checking the option,
adjusting the range-values).
So, is there any way to get this checked by default (that would be one
step forward) and preferably also adjust the values while we're at it?
Many thanks in advance,
Ferry
Ferry,
there's no way that I'm aware of. One posibility is to script out the
publication and use a find and replace in notepad to make the alteration
then drop the original and recreate the publication using this script -
admittedly not nice but would save a lot of leg-work.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||From Paul Ibison :
> Ferry,
> there's no way that I'm aware of. One posibility is to script out the
> publication and use a find and replace in notepad to make the alteration then
> drop the original and recreate the publication using this script - admittedly
> not nice but would save a lot of leg-work.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
Thanks Paul. I guess I'll have a look and see if I can do either that
or perhaps find some 'backdoor'...
Ferry
|||From Ferry :
> From Paul Ibison :
> Thanks Paul. I guess I'll have a look and see if I can do either that or
> perhaps find some 'backdoor'...
> Ferry
Having said that, I started a more detailed search on Google and came
up with this one. Going to check this later:
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
/*
'************************************************* **
' Purpose :Add Identity range to the user defined Tables under a given
publisher
' Inputs :Publisher Name and Identity Range
' Returns :None
' Author :Mahesh M Kodli
'************************************************* ***
CREATE PROCEDURE AddMergeArticle
@.pPublisherName VARCHAR(255),
@.pIdentityRange BIGINT
As
DECLARE @.tRV INT
DECLARE @.tArticle VARCHAR(255)
SET @.tRV = 0
DECLARE Merge_Article_Cursor CURSOR FOR
--Get all the user defined Tables for which to add Identity Range
SELECT TABLE_NAME TableName FROM INFORMATION_SCHEMA.TABLES WHERE
rtrim(ltrim(table_type))='BASE TABLE'
AND TABLE_NAME Not like 'Conflict%' AND TABLE_NAME Not like
'dtproperties'
AND TABLE_NAME Not like 'sys%' AND TABLE_NAME Not like 'MS%'
OPEN Merge_Article_Cursor
FETCH NEXT FROM Merge_Article_Cursor INTO @.tArticle
WHILE @.@.FETCH_STATUS = 0
BEGIN
--Check if the Table has identity column and accordingly set the Auto
--Identity Range to TRUE or FALSE Before adding Identity Range to the
--article
IF OBJECTPROPERTY ( OBJECT_ID(@.tArticle), 'TableHasIdentity') = 1
BEGIN
IF NOT EXISTS (SELECT * FROM sysmergeextendedarticlesview WHERE name
= @.tArticle AND pubid IN (select pubid FROM sysmergepublications WHERE
name like @.pPublisherName AND UPPER(publisher)=UPPER(@.@.servername) and
publisher_db=db_name()))
BEGIN
--Use the System stored procedure add merge article to add Identity
range for -- each article
EXECUTE sp_addmergearticle @.publication = @.pPublisherName, @.article =
@.tArticle, @.source_owner = N'dbo', @.source_object = @.tArticle, @.type =
N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause =
null, @.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'true', @.pub_identity_range = @.pIdentityRange,
@.identity_range = @.pIdentityRange, @.threshold = 80,
@.verify_resolver_signature = 0, @.allow_interactive_resolver = N'false',
@.fast_multicol_updateproc = N'true', @.check_permissions =
0,@.force_invalidate_snapshot=1
END
END
ELSE
BEGIN
IF NOT EXISTS (SELECT * FROM sysmergeextendedarticlesview WHERE name
= @.tArticle AND pubid IN (select pubid FROM sysmergepublications WHERE
name like @.pPublisherName AND UPPER(publisher)=UPPER(@.@.servername) and
publisher_db=db_name()))
BEGIN
EXECUTE sp_addmergearticle @.publication = @.pPublisherName, @.article
= @.tArticle, @.source_owner = N'dbo', @.source_object = @.tArticle, @.type
= N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause =
null, @.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'False', @.pub_identity_range = NULL,
@.identity_range = NULL, @.threshold = NULL, @.verify_resolver_signature =
0, @.allow_interactive_resolver = N'false', @.fast_multicol_updateproc =
N'true', @.check_permissions = 0,@.force_invalidate_snapshot=1
END
END
FETCH NEXT FROM Merge_Article_Cursor INTO @.tArticle
END
CLOSE Merge_Article_Cursor
DEALLOCATE Merge_Article_Cursor
IF (@.@.ERROR <> 0)
BEGIN
SELECT @.tRV = -95 --UnSuccessful
GOTO XIT
END
XIT:
RETURN @.tRV
|||Ferry,
thanks for the heads up. I've found the link
http://www.devarticles.com/c/a/SQL-S...2000-Part-2/3/
and will add it onto my site. The only problem with the proc above is that
it assumes you want to replicate all tables, so there's room for another
(simpler) version which takes a tablename as a third parameter.
To have this occur without any intervention such as using Mahesh's script
you would have to edit the stored procedure sp_addmergearticle itself to
hardcode the automatic range management. This is a posibility but which
obviously invalidates support agreements - depends on how confident you are
of getting it spot on

Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
merge replication with pull subscriber(compress snapshot)
I am trying to implement merge publication with compress snapshot, copy it
to the subscriber,
create a pull subscriber with the alternate folder(where the snapshot was
copied to)
and then run the agent for synchronization (first time).
i get error that the table in the publication does not exist in the
subscriber database.
It seems that the agent ignores the snapshot and it tries to just merge the
changes between publisher and subscriber.
when i create the table manually at the subscriber with the rowguid column,
it does not fail but it stills does not aplly the snapshot.
if i update/insert new row and run the agent it does merge the changes.
am i missing a crucial step in the process that causes that problem?
Thanks in advance
Daniel
daniel
Please can you post up the error message in its entirety. I suspect that it
is related to a script missing. Also, please try not using the CAB file
method. If you need to compress the snapshot, zip it up and unzip on the
subscriber (I only say this because I've never tested using an alternative
folder with a CAB file).
Paul Ibison
|||Hi and thank u for the replying.
When i start the agent for the first time i get the following error:
"Table 't3' does not exist in the Subscriber database."
At the log i can see that he does try to get the snapshot from alternate
folder:
" Snapshot will be applied from the alternate folder ..."
thanks in advance
Daniel
daniel
"Paul Ibison" wrote:
> Please can you post up the error message in its entirety. I suspect that it
> is related to a script missing. Also, please try not using the CAB file
> method. If you need to compress the snapshot, zip it up and unzip on the
> subscriber (I only say this because I've never tested using an alternative
> folder with a CAB file).
> Paul Ibison
|||Interesting - if you enable full logging is there more info? Also, are you
using the uncompressed snapshot files (if not please try this way also)? In
the snapshot files do you see the table creation script for t3?
(the alternative to this investigation if you like is to do a nosync
initialization).
Paul Ibison
|||Hi Paul
Yes there is a script for table creation.
I tried to use the uncompressed and i got the same error.
How do i do the no sync initialization?
daniel
"Paul Ibison" wrote:
> Interesting - if you enable full logging is there more info? Also, are you
> using the uncompressed snapshot files (if not please try this way also)? In
> the snapshot files do you see the table creation script for t3?
> (the alternative to this investigation if you like is to do a nosync
> initialization).
> Paul Ibison
|||Please have a look here. It largely applies to transactional, but mostly the
same info applies: http://www.replicationanswers.com/NoSyncInitializations.asp
HTH,
Paul Ibison
Monday, March 26, 2012
Merge Replication 'wait' issues
I have created 3 merge publications on my server. I notice
that when I right click and try to view the properties of
the publication, SQL takes a long time to pull up the
properties of the publication.
Any ideas on how to make this 'wait' time less or why this
occurs?
Thanks,
niv
Niv,
a few things to try to narrow it down:
when you run sp_helpmergepublication does it also take a long time? How about sp_helpmergearticle? How many records are there in sysmergepublications and sysmergesubscriptions? Are things generally slow in EM? If it is just the merge publications, what oc
curs if you open another EM and look at the current activity windows - any evidence of blocking?
HTH,
Paul Ibison
|||Paul,
Tried both those procedures and it returned very fast.
Looks like it may have been another issue. I can get into
the properties quickly now... hmm. weird..
Anyhow,
I am in need of some advice in regards to the best
replication option to select when making changes to
triggers, views, sprocs.
I tried this at one point but I think I choose drop and
recreate.. needless to say.. this was not good

I await your reply.
niv
>--Original Message--
>Niv,
>a few things to try to narrow it down:
>when you run sp_helpmergepublication does it also take a
long time? How about sp_helpmergearticle? How many records
are there in sysmergepublications and
sysmergesubscriptions? Are things generally slow in EM? If
it is just the merge publications, what occurs if you open
another EM and look at the current activity windows - any
evidence of blocking?
>HTH,
>Paul Ibison
>.
>
|||Niv,
glad it's working.
You mention "Changes to triggers, views, sprocs" - are these objects created by SQL Server as part of the replication setup, or are they user objects. If the former, I would advise against altering, although in the case of a recent poster I mentioned edit
ing the triggers, but this was a specific business scenario.
If they are user objects then you might replicate the views and sprocs as separate articles. Triggers are more difficult, and you can use sp_addscriptexec if you are using transactional replication but if not then scripting changes and using linked server
s may be considered.
HTH,
Paul Ibison
Merge Replication using a guid as a dynamic filter
Hi ...
I am working on a project where the server version of application has vouchers from different entities. I have created a publication manually. My next step was to create a client subscription using rmo and to execute a pull. This part works fine. Code samples from http://msdn2.microsoft.com/en-us/library/ms147314.aspx
My next step would be to implement dynamic filtering using the guid of the entity as a parameter.
I dont want to use suser_sname() or host_name() as I want to use a fixed login for the replication for all users, and a client could have several host dbs (sql express, sql mobile)
My goal would be to pass a guid-value to the HostName Property of the MergePullSubscription class and convert it to an uniquidentifier and use it as a filter as I have not found any other way to pass a guid as a filter.
RMO-Code:
subscription.HostName = "4bb0e468-c68a-4253-ba82-f71c3a6e302d"
Filter:
SELECT <published_columns> FROM [dbo].[voucher] WHERE [entity_ID] = dbo.fx_ConvertHostToEntity()
Function:
create function fx_ConvertHostToEntity()
returns uniqueidentifier
as
Begin
declare @.host nvarchar(50)
set @.host = host_name()
declare @.entity uniqueidentifier
set @.entity = cast( @.host as uniqueidentifier)
return @.entity
End
When trying to set the filter sql server complains that a character string cannot be casted to a uniqueidentifier - so i can not set this filter. Is there a way to pass a parameter other then the username or the hostname as a filter?
SELECT <published_columns> FROM [dbo].[voucher] WHERE [entity_ID] =@.entity, where @.entity is a guid
Thanks for your support
Alex
Hi, Alex,
You can convert the string to binary then to uniqueidentifier, like following:
declare @.host nvarchar(50)
set @.host = host_name()
declare @.entity uniqueidentifier
set @.entity = cast( convert(varbinary, @.host) as uniqueidentifier)
print @.entity
Output:
00450044-004C-004C-3000-340032003700
Thanks,
Zhiqiang Feng
|||Thanks for the info changed the function according to your suggestion.
Now a new problem arrises: I receive 0 rows for the filtered tables. When changing the funktion to
ALTER FUNCTION [dbo].[fx_ConvertHostToEntity] ()
returns uniqueidentifier
as
Begin
declare @.host nvarchar(50)
set @.host = host_name()
declare @.entity uniqueidentifier
set @.entity = cast( convert(varbinary, @.host) as uniqueidentifier)
-- return @.entity
return '4bb0e468-c68a-4253-ba82-f71c3a6e302d'
End
I get the rows in the replicated table. So the problem must be somewhere either in the creation of the sanpshots or the resolution of the hostname
|||
Using Replication Monitor for the publication I also found out using the properties of the publication that the snapshot for the data partition has not been created. So I did this manually and will code it later on. When replicating again I got the follwowing error shown up in the Replication Monitor (I left out the first one as I am not using web sync right now):
Partitioned snapshot validation failed for this Subscriber. The snapshot validation token stored in the specified partitioned snapshot location does not match the value '{00620034-0062-0030-6500-340036003800}' used by the Merge Agent when evaluating the parameterized filter function. If specifying the location of the partitioned snapshot (using -DynamicSnapshotLocation), you must ensure that the snapshot files in that directory belong to the correct partition or allow the Merge Agent to automatically detec (Source: MSSQL_REPL, Error number: MSSQL_REPL27223)
Find the full source code below:
Imports Microsoft.SqlServer.Replication
Imports Microsoft.SqlServer.Management.Common
Public Class Replication
Private subscriberName As String
Private publisherName As String
Private windowsLogin As String
Private windowsPWD As String
Private publicationName As String
Private publicationDbName As String
Private subscriptionDbName As String
Private passedHostname As String
''' <summary>
''' a new instance of the replication object
''' </summary>
''' <param name="EntityID">id of the entity as string</param>
''' <param name="SubscriberHost">the hostname of the subscribing sql instance</param>
''' <param name="PublisherHost">the hostname of the publishing sql instance</param>
''' <param name="Login">the name of the windows login to authenticate towards the publisher: domain\user</param>
''' <param name="PWD">the password</param>
''' <param name="Publication">the name of the puplicaiton on the publisher</param>
''' <param name="PublicationDB">the name of the puplication db</param>
''' <param name="SubscriptionDB">the name of the subscription db</param>
''' <remarks></remarks>
Sub New(ByVal EntityID As Guid, ByVal SubscriberHost As String, ByVal PublisherHost As String, ByVal Login As String, ByVal PWD As String, ByVal Publication As String, ByVal PublicationDB As String, ByVal SubscriptionDB As String)
subscriberName = SubscriberHost
publisherName = PublisherHost
'the guid of the entity is passed as hostname to be used for filtering
PassedHostname = EntityID.ToString
windowsLogin = Login
windowsPWD = PWD
publicationName = Publication
subscriptionDbName = SubscriptionDB
publicationDbName = PublicationDB
End Sub
Sub SetupPullSubscription()
'Create connections to the Publisher and Subscriber.
Dim subscriberConn As ServerConnection = New ServerConnection(subscriberName)
Dim publisherConn As ServerConnection = New ServerConnection(publisherName)
' Create the objects that we need.
Dim publication As MergePublication
Dim subscription As MergePullSubscription
Try
' Connect to the Subscriber.
subscriberConn.Connect()
' Ensure that the publication exists and that
' it supports pull subscriptions.
publication = New MergePublication()
publication.Name = publicationName
publication.DatabaseName = publicationDbName
publication.ConnectionContext = publisherConn
If publication.LoadProperties() Then
If (publication.Attributes And PublicationAttributes.AllowPull) = 0 Then
publication.Attributes = publication.Attributes Or PublicationAttributes.AllowPull
End If
' Define the pull subscription.
subscription = New MergePullSubscription()
subscription.ConnectionContext = subscriberConn
subscription.PublisherName = publisherName
subscription.PublicationName = publicationName
subscription.PublicationDBName = publicationDbName
subscription.DatabaseName = subscriptionDbName
subscription.HostName = passedHostname
' Specify the Windows login credentials for the Merge Agent job.
subscription.SynchronizationAgentProcessSecurity.Login = windowsLogin
subscription.SynchronizationAgentProcessSecurity.Password = windowsPWD
' Make sure that the agent job for the subscription is created.
subscription.CreateSyncAgentByDefault = True
' Create the pull subscription at the Subscriber.
subscription.Create()
Dim registered As Boolean = False
' Verify that the subscription is not already registered.
For Each existing As MergeSubscription In _
publication.EnumSubscriptions()
If existing.SubscriberName = subscriberName Then
registered = True
End If
Next
If Not registered Then
' Register the local subscription with the Publisher.
publication.MakePullSubscriptionWellKnown(subscriberName, subscriptionDbName, SubscriptionSyncType.Automatic, MergeSubscriberType.Local, 0)
'publication.MakePullSubscriptionWellKnown(subscriberName, subscriptionDbName, SubscriptionSyncType.Automatic, MergeSubscriberType.Local, 0)
End If
Else
' Do something here if the publication does not exist.
Throw New ApplicationException(String.Format("The publication '{0}' does not exist on {1}.", publicationName, publisherName))
End If
Catch ex As Exception
' Implement the appropriate error handling here.
Throw New ApplicationException(String.Format("The subscription to {0} could not be created.", publicationName), ex)
Finally
subscriberConn.Disconnect()
publisherConn.Disconnect()
End Try
End Sub
Sub PullMergeReplication()
' Create a connection to the Subscriber.
Dim conn As ServerConnection = New ServerConnection(subscriberName)
Dim subscription As MergePullSubscription
Try
' Connect to the Subscriber.
conn.Connect()
' Define subscription properties.
subscription = New MergePullSubscription()
subscription.ConnectionContext = conn
subscription.DatabaseName = subscriptionDbName
subscription.PublisherName = publisherName
subscription.PublicationDBName = publicationDbName
subscription.PublicationName = publicationName
' If the pull subscription and the job exists, start the agent job.
If subscription.LoadProperties() And Not subscription.AgentJobId Is Nothing Then
subscription.SynchronizeWithJob()
Else
' Do something here if the subscription does not exist.
Throw New ApplicationException(String.Format("A subscription to '{0}' does not exists on {1}", publicationName, subscriberName))
End If
Catch ex As Exception
' Do appropriate error handling here.
Throw New ApplicationException("The subscription could not be synchronized.", ex)
Finally
conn.Disconnect()
End Try
End Sub
End Class
|||
this means you're trying to apply a dynamic snapshot that's not for your partition. i.e. your filter is for 'StoreA', but you're trying to apply snapshot belonging to 'StoreB'.
|||After finding no solution to the problem, feeling that the problem has something to to with the conversion vom guid to string, I decided to have a second col in the table that was filled with a trigger: the guid converted to nvarchar.
And suddenly I knew where the problem was hiding:
hostname value: 4bb0e468-c68a-4253-ba82-f71c3a6e302d
cast( convert(varbinary,host_name()) as uniqueidentifier) -> 4BB0E468-C68A-4253-BA82-F71C3A6E302D
And that is the solution: When using a guid as the hostname and filter, the values have to be either both lower case or upper case. Otherwise you will get an empty result for dynamicly filtered tables :)
Thanks for your support
Alex
Merge Replication to multiple servers losing data
We are using merge replication between four servers (1 publisher & 3
subscribers). The same articles (tables) are in each publication. I run the
application which changes data in some tables and adds records in another
table. The inserted data is immediately updated via trigger. After running
the application all expected data is present. If I manually force
replication to each subscriber sequentially, all expected data is present.
If I run replication between the servers at the same time, the table to
which data was added will lose some data. The data lost was not the data
that was just added. We are running SQL Server 2000 SP3a on all servers. Any
ideas?
tia,
Paul
Look at the 'view conflict' at replication monitor...
"PaulW" <MSNewsGroup@.Digi-Sol.com>
news:urv9zNxlHHA.1216@.TK2MSFTNGP03.phx.gbl...
> Hi,
> We are using merge replication between four servers (1 publisher & 3
> subscribers). The same articles (tables) are in each publication. I run
> the application which changes data in some tables and adds records in
> another table. The inserted data is immediately updated via trigger.
> After running the application all expected data is present. If I manually
> force replication to each subscriber sequentially, all expected data is
> present. If I run replication between the servers at the same time, the
> table to which data was added will lose some data. The data lost was not
> the data that was just added. We are running SQL Server 2000 SP3a on all
> servers. Any ideas?
> tia,
> Paul
>
|||There are no recorded conflicts. This table only has data inserted, then
updated through a trigger. We did view the transaction log. The only entries
with the table were the inserts we initiated followed by a delete/insert for
the trigger update.
Paul
"Grigoris Tsolakidis" <gcholakidis@.spam_remove.hotmail.com> wrote in message
news:uhRQsHGmHHA.4852@.TK2MSFTNGP03.phx.gbl...
> Look at the 'view conflict' at replication monitor...
> "PaulW" <MSNewsGroup@.Digi-Sol.com>
> news:urv9zNxlHHA.1216@.TK2MSFTNGP03.phx.gbl...
>
sql
Merge replication throwing very weird error messages
I've been setting up subscriptions to a merge publication for the past 3 days. All of a sudden, I'm getting a pile of very strange errors. Replication is configured. I have 16 subscribers to an existing publication configured and synchronizing changes without any issues. The script that I'm using to create all of the subscriptions is as follows:
use [PIC]
exec sp_addmergesubscription @.publication = N'PIC', @.subscriber = N'machinename\SQLEXPRESS',
@.subscriber_db = N'MyDatabase', @.subscription_type = N'Push', @.sync_type = N'Automatic',
@.subscriber_type = N'Global', @.subscription_priority = 75, @.description = N'', @.use_interactive_resolver = N'False'
exec sp_addmergepushsubscription_agent @.publication = N'PIC', @.subscriber = N'machinename\SQLEXPRESS',
@.subscriber_db = N'MyDatabase', @.job_login = null, @.job_password = null, @.subscriber_security_mode = 1,
@.publisher_security_mode = 1, @.frequency_type = 64, @.frequency_interval = 0, @.frequency_relative_interval = 0,
@.frequency_recurrence_factor = 0, @.frequency_subday = 0, @.frequency_subday_interval = 0, @.active_start_time_of_day = 0,
@.active_end_time_of_day = 235959, @.active_start_date = 0, @.active_end_date = 0
GO
The last one that I added #17, gives the following errors after successfully creating the subscription.
Command attempted:
{call sys.sp_MSmergesubscribedb ('true', 0) }
Error messages:
The merge process could not initialize the subscription. Ensure that the subscription registration exists at the publisher, and reregister the subscription if necessary. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201011)
Get help: http://help/MSSQL_REPL-2147201011
RegCreateKeyEx() returned error 5, 'Access is denied.' (Source: MSSQLServer, Error number: 22002)
Get help: http://help/22002
Could not add article resolver 'Microsoft SQL Server Additive Conflict Resolver' information to the registry (Source: MSSQLServer, Error number: 21713)
Get help: http://help/21713
Could not register article resolver: 'Microsoft SQL Server Additive Conflict Resolver'. (Source: MSSQLServer, Error number: 21715)
Get help: http://help/21715
The system tables for merge replication could not be created successfully. (Source: MSSQLServer, Error number: 20008)
Get help: http://help/20008
I've tried to manually create it using the GUI and get an even stranger error message as follows:
TITLE: New Subscription Wizard
Microsoft SQL Server Management Studio is unable to access replication components because replication is not installed on this instance of SQL Server. For information about installing replication, see the topic Installing Replication in SQL Server Books Online.
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.06&EvtSrc=Microsoft.SqlServer.Management.UI.ReplUtilitiesErrorSR&EvtID=ReplicationNotInstalled&LinkId=20476
ADDITIONAL INFORMATION:
Replication components are not installed on this server. Run SQL Server Setup again and select the option to install replication. (Microsoft SQL Server, Error: 21028)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=21028&LinkId=20476
BUTTONS:
OK
I very obviously have replication installed by virtue of the fact that I have a publication and 16 subscriptions that are currently synchronizing. Any ideas?
Yes, I can connect to the subscriber from the server. That's how I created the subscription database in the first place, by connecting a query window to the subscriber and issuing a create database statement.|||Is it the same account you are using to run this command as the other 16 subscriptions?
Did the sql server service account change between the success and this failure attempt?
Did you add sp_addmergesubscription_agent to those successful subscriptions too?
|||Same account was used to run these two commands for all of the other 16 subscriptions. No, the service account did not change. Yes, we successfully added sp_addmergesubscription_agent to the other 16.Merge replication throwing very weird error messages
I've been setting up subscriptions to a merge publication for the past 3 days. All of a sudden, I'm getting a pile of very strange errors. Replication is configured. I have 16 subscribers to an existing publication configured and synchronizing changes without any issues. The script that I'm using to create all of the subscriptions is as follows:
use [PIC]
exec sp_addmergesubscription @.publication = N'PIC', @.subscriber = N'machinename\SQLEXPRESS',
@.subscriber_db = N'MyDatabase', @.subscription_type = N'Push', @.sync_type = N'Automatic',
@.subscriber_type = N'Global', @.subscription_priority = 75, @.description = N'', @.use_interactive_resolver = N'False'
exec sp_addmergepushsubscription_agent @.publication = N'PIC', @.subscriber = N'machinename\SQLEXPRESS',
@.subscriber_db = N'MyDatabase', @.job_login = null, @.job_password = null, @.subscriber_security_mode = 1,
@.publisher_security_mode = 1, @.frequency_type = 64, @.frequency_interval = 0, @.frequency_relative_interval = 0,
@.frequency_recurrence_factor = 0, @.frequency_subday = 0, @.frequency_subday_interval = 0, @.active_start_time_of_day = 0,
@.active_end_time_of_day = 235959, @.active_start_date = 0, @.active_end_date = 0
GO
The last one that I added #17, gives the following errors after successfully creating the subscription.
Command attempted:
{call sys.sp_MSmergesubscribedb ('true', 0) }
Error messages:
The merge process could not initialize the subscription. Ensure that the subscription registration exists at the publisher, and reregister the subscription if necessary. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201011)
Get help: http://help/MSSQL_REPL-2147201011
RegCreateKeyEx() returned error 5, 'Access is denied.' (Source: MSSQLServer, Error number: 22002)
Get help: http://help/22002
Could not add article resolver 'Microsoft SQL Server Additive Conflict Resolver' information to the registry (Source: MSSQLServer, Error number: 21713)
Get help: http://help/21713
Could not register article resolver: 'Microsoft SQL Server Additive Conflict Resolver'. (Source: MSSQLServer, Error number: 21715)
Get help: http://help/21715
The system tables for merge replication could not be created successfully. (Source: MSSQLServer, Error number: 20008)
Get help: http://help/20008
I've tried to manually create it using the GUI and get an even stranger error message as follows:
TITLE: New Subscription Wizard
Microsoft SQL Server Management Studio is unable to access replication components because replication is not installed on this instance of SQL Server. For information about installing replication, see the topic Installing Replication in SQL Server Books Online.
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.06&EvtSrc=Microsoft.SqlServer.Management.UI.ReplUtilitiesErrorSR&EvtID=ReplicationNotInstalled&LinkId=20476
ADDITIONAL INFORMATION:
Replication components are not installed on this server. Run SQL Server Setup again and select the option to install replication. (Microsoft SQL Server, Error: 21028)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=21028&LinkId=20476
BUTTONS:
OK
I very obviously have replication installed by virtue of the fact that I have a publication and 16 subscriptions that are currently synchronizing. Any ideas?
Yes, I can connect to the subscriber from the server. That's how I created the subscription database in the first place, by connecting a query window to the subscriber and issuing a create database statement.|||Is it the same account you are using to run this command as the other 16 subscriptions?
Did the sql server service account change between the success and this failure attempt?
Did you add sp_addmergesubscription_agent to those successful subscriptions too?
|||Same account was used to run these two commands for all of the other 16 subscriptions. No, the service account did not change. Yes, we successfully added sp_addmergesubscription_agent to the other 16.Friday, March 23, 2012
Merge Replication structural change
Hi
Created a table User with the fields of Uname varchar(30) and pwd varchar(30) in SQL server 2005.
I need to create a publication and Merge subscription with the below structural changes
User table with the fields of Uname varchar(25) and pwd carchar(30).
The publication table having the Uname varchar(30) but we change this to the subscription table as Uname varchar(25).
Is it possible? If you, please give the details.
Thanks.
Hello,
Is it intended to have different size of Uname? Otherwise, please try to ALTER COLUMN Uname to varchar(25) on the publisher side and this change should be populated to the subscriber side.
Thanks.
This posting is provided AS IS with no warranties, and confers no rights
|||Hi
Thanks for your reply.
I don't want to change this structural change in publication side. I need this change in subscription side only. so that i keep my Db with original structure and i changed the subscription db with modified structure.
|||as a workaround, you can alter table ..varchar(25), propagate the changes, then set @.replicate_ddl to 0, and alter your table back to varchar(30).|||Thanks Greg I got some idea from your reply.
If I have only one subscription means this is OK. but I am creating multiple subscription at any time.
Here is my complete requirement.
I have two publications. there is some difference in these two publications.
I am creating subscription from WinMobile device. I configure the publication name there. So that it refer the corresponding publication. These two publications are refer same tables but there is some article changes. I don't want to change the structure in both. I need to change this in one publication and the other one having the same as the DB structure.
The users subscribe the publication at any time. so we are not able to alter the tables each and every time.
Thanks again.
|||I would say you have a design issue then. Replication is used primarily to keep data in sync in multiple locations, if the column sizes must be different between data and source, you can try the workaround I mentioned above or fix your apps so that the schemas are always consistent.|||OK Greg. Thanks.Merge Replication structural change
Hi
Created a table User with the fields of Uname varchar(30) and pwd varchar(30) in SQL server 2005.
I need to create a publication and Merge subscription with the below structural changes
User table with the fields of Uname varchar(25) and pwd carchar(30).
The publication table having the Uname varchar(30) but we change this to the subscription table as Uname varchar(25).
Is it possible? If you, please give the details.
Thanks.
Hello,
Is it intended to have different size of Uname? Otherwise, please try to ALTER COLUMN Uname to varchar(25) on the publisher side and this change should be populated to the subscriber side.
Thanks.
This posting is provided AS IS with no warranties, and confers no rights
|||Hi
Thanks for your reply.
I don't want to change this structural change in publication side. I need this change in subscription side only. so that i keep my Db with original structure and i changed the subscription db with modified structure.
|||as a workaround, you can alter table ..varchar(25), propagate the changes, then set @.replicate_ddl to 0, and alter your table back to varchar(30).|||Thanks Greg I got some idea from your reply.
If I have only one subscription means this is OK. but I am creating multiple subscription at any time.
Here is my complete requirement.
I have two publications. there is some difference in these two publications.
I am creating subscription from WinMobile device. I configure the publication name there. So that it refer the corresponding publication. These two publications are refer same tables but there is some article changes. I don't want to change the structure in both. I need to change this in one publication and the other one having the same as the DB structure.
The users subscribe the publication at any time. so we are not able to alter the tables each and every time.
Thanks again.
|||I would say you have a design issue then. Replication is used primarily to keep data in sync in multiple locations, if the column sizes must be different between data and source, you can try the workaround I mentioned above or fix your apps so that the schemas are always consistent.|||OK Greg. Thanks.merge replication snapshot agent fails
the snapshot agent after I've finished the 'New Publication Wizard'.
This doesn't make sense to me as it is an automatic process. Also, it
looks like it is complaining about a 'dbo.MSmerge_cont...' view which
is a view created automatically for the merge publication.
ERROR MESSAGE:
The identifier that starts with
'<EVENT_INSTANCE><EventType>CREATE_VIEW</EventType><PostTime>2006-11-09T09:56:48.390</PostTime><SPID>152</SPID><ServerName>XF4SWC'
is too long. Maximum length is 128.
FULL DETAILS:
Message: The identifier that starts with
'<EVENT_INSTANCE><EventType>CREATE_VIEW</EventType><PostTime>2006-11-09T09:56:48.390</PostTime><SPID>152</SPID><ServerName>XF4SWC'
is too long. Maximum length is 128.
Command Text: IF
OBJECT_ID(N'[<EVENT_INSTANCE><EventType>CREATE_VIE W</EventType><PostTime>2006-11-09T09:56:48.390</PostTime><SPID>152</SPID><ServerName>XF4SWCS464</ServerName><LoginName>NT
AUTHORITY\SYSTEM</LoginName><UserName>dbo</UserName><DatabaseName>liport2_gts</DatabaseName><SchemaName>dbo</SchemaName><ObjectName>MSmerge_contAE2EB588ABFA4C1 3825D4D44CB2D50CB_90</ObjectName><ObjectType>VIEW</ObjectType><TSQLCommand><SetOptions
ANSI_NULLS="OFF" ANSI_NULL_DEFAULT="ON" ANSI_PADDING="ON"
QUOTED_IDENTIFIER="ON" ENCRYPTED="FALSE" /><CommandText>create view
dbo.MSmerge_contAE2EB588ABFA4C13825D4D44CB2D50CB_9 0 as select * from
MSmerge_contents where 1 =
2</CommandText></TSQLCommand></EVENT_INSTANCE>]', 'V') IS NOT NULL DROP
VIEW
[<EVENT_INSTANCE><EventType>CREATE_VIEW</EventType><PostTime>2006-11-09T09:56:48.390</PostTime><SPID>152</SPID><ServerName>XF4SWCS464</ServerName><LoginName>NT
AUTHORITY\SYSTEM</LoginName><UserName>dbo</UserName><DatabaseName>liport2_gts</DatabaseName><SchemaName>dbo</SchemaName><ObjectName>MSmerge_contAE2EB588ABFA4C1 3825D4D44CB2D50CB_90</ObjectName><ObjectType>VIEW</ObjectType><TSQLCommand><SetOptions
ANSI_NULLS="OFF" ANSI_NULL_DEFAULT="ON" ANSI_PADDING="ON"
QUOTED_IDENTIFIER="ON" ENCRYPTED="FALSE" /><CommandText>create view
dbo.MSmerge_contAE2EB588ABFA4C13825D4D44CB2D50CB_9 0 as select * from
MSmerge_contents where 1 =
2</CommandText></TSQLCommand></EVENT_INSTANCE>]
Parameters:
Stack: at
Microsoft.SqlServer.Replication.AgentCore.ReMapSql Exception(SqlException
e, SqlCommand command)
at
Microsoft.SqlServer.Replication.AgentCore.AgentExe cuteNonQuery(SqlCommand
command, Int32 queryTimeout)
at
Microsoft.SqlServer.Replication.AgentCore.ExecuteD iscardResults(CommandSetupDelegate
commandSetupDelegate, Int32 queryTimeout)
at
Microsoft.SqlServer.Replication.AgentCore.ExecuteA dHocQueryDiscardResults(String
strQuery, SqlConnection connection)
at
Microsoft.SqlServer.Replication.Snapshot.MergeSnap shotProvider.GenerateSystemTableBcpFiles()
at
Microsoft.SqlServer.Replication.Snapshot.MergeSnap shotProvider.DoPostArticleFilesGenerationProcessin g()
at
Microsoft.SqlServer.Replication.Snapshot.SqlServer SnapshotProvider.GenerateSnapshot()
at
Microsoft.SqlServer.Replication.SnapshotGeneration Agent.InternalRun()
at Microsoft.SqlServer.Replication.AgentCore.Run() (Source:
MSSQLServer, Error number: 103)
Get help: http://help/103
Server XF4SWCS464, Level 15, State 4, Procedure , Line 1
The identifier that starts with
'<EVENT_INSTANCE><EventType>CREATE_VIEW</EventType><PostTime>2006-11-09T09:56:48.390</PostTime><SPID>152</SPID><ServerName>XF4SWC'
is too long. Maximum length is 128. (Source: MSSQLServer, Error number:
103)
Get help: http://help/103
can you enable logging and post the log back here?
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B312292&sd=tech
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
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
"gabe" <gschnaub@.gmail.com> wrote in message
news:1163095482.849374.43790@.m73g2000cwd.googlegro ups.com...
> I'm trying to setup merge replication and get the following error from
> the snapshot agent after I've finished the 'New Publication Wizard'.
> This doesn't make sense to me as it is an automatic process. Also, it
> looks like it is complaining about a 'dbo.MSmerge_cont...' view which
> is a view created automatically for the merge publication.
> ERROR MESSAGE:
> The identifier that starts with
> '<EVENT_INSTANCE><EventType>CREATE_VIEW</EventType><PostTime>2006-11-09T09:56:48.390</PostTime><SPID>152</SPID><ServerName>XF4SWC'
> is too long. Maximum length is 128.
> FULL DETAILS:
> Message: The identifier that starts with
> '<EVENT_INSTANCE><EventType>CREATE_VIEW</EventType><PostTime>2006-11-09T09:56:48.390</PostTime><SPID>152</SPID><ServerName>XF4SWC'
> is too long. Maximum length is 128.
> Command Text: IF
> OBJECT_ID(N'[<EVENT_INSTANCE><EventType>CREATE_VIE W</EventType><PostTime>2006-11-09T09:56:48.390</PostTime><SPID>152</SPID><ServerName>XF4SWCS464</ServerName><LoginName>NT
> AUTHORITY\SYSTEM</LoginName><UserName>dbo</UserName><DatabaseName>liport2_gts</DatabaseName><SchemaName>dbo</SchemaName><ObjectName>MSmerge_contAE2EB588ABFA4C1 3825D4D44CB2D50CB_90</ObjectName><ObjectType>VIEW</ObjectType><TSQLCommand><SetOptions
> ANSI_NULLS="OFF" ANSI_NULL_DEFAULT="ON" ANSI_PADDING="ON"
> QUOTED_IDENTIFIER="ON" ENCRYPTED="FALSE" /><CommandText>create view
> dbo.MSmerge_contAE2EB588ABFA4C13825D4D44CB2D50CB_9 0 as select * from
> MSmerge_contents where 1 =
> 2</CommandText></TSQLCommand></EVENT_INSTANCE>]', 'V') IS NOT NULL DROP
> VIEW
> [<EVENT_INSTANCE><EventType>CREATE_VIEW</EventType><PostTime>2006-11-09T09:56:48.390</PostTime><SPID>152</SPID><ServerName>XF4SWCS464</ServerName><LoginName>NT
> AUTHORITY\SYSTEM</LoginName><UserName>dbo</UserName><DatabaseName>liport2_gts</DatabaseName><SchemaName>dbo</SchemaName><ObjectName>MSmerge_contAE2EB588ABFA4C1 3825D4D44CB2D50CB_90</ObjectName><ObjectType>VIEW</ObjectType><TSQLCommand><SetOptions
> ANSI_NULLS="OFF" ANSI_NULL_DEFAULT="ON" ANSI_PADDING="ON"
> QUOTED_IDENTIFIER="ON" ENCRYPTED="FALSE" /><CommandText>create view
> dbo.MSmerge_contAE2EB588ABFA4C13825D4D44CB2D50CB_9 0 as select * from
> MSmerge_contents where 1 =
> 2</CommandText></TSQLCommand></EVENT_INSTANCE>]
> Parameters:
> Stack: at
> Microsoft.SqlServer.Replication.AgentCore.ReMapSql Exception(SqlException
> e, SqlCommand command)
> at
> Microsoft.SqlServer.Replication.AgentCore.AgentExe cuteNonQuery(SqlCommand
> command, Int32 queryTimeout)
> at
> Microsoft.SqlServer.Replication.AgentCore.ExecuteD iscardResults(CommandSetupDelegate
> commandSetupDelegate, Int32 queryTimeout)
> at
> Microsoft.SqlServer.Replication.AgentCore.ExecuteA dHocQueryDiscardResults(String
> strQuery, SqlConnection connection)
> at
> Microsoft.SqlServer.Replication.Snapshot.MergeSnap shotProvider.GenerateSystemTableBcpFiles()
> at
> Microsoft.SqlServer.Replication.Snapshot.MergeSnap shotProvider.DoPostArticleFilesGenerationProcessin g()
> at
> Microsoft.SqlServer.Replication.Snapshot.SqlServer SnapshotProvider.GenerateSnapshot()
> at
> Microsoft.SqlServer.Replication.SnapshotGeneration Agent.InternalRun()
> at Microsoft.SqlServer.Replication.AgentCore.Run() (Source:
> MSSQLServer, Error number: 103)
> Get help: http://help/103
> Server XF4SWCS464, Level 15, State 4, Procedure , Line 1
> The identifier that starts with
> '<EVENT_INSTANCE><EventType>CREATE_VIEW</EventType><PostTime>2006-11-09T09:56:48.390</PostTime><SPID>152</SPID><ServerName>XF4SWC'
> is too long. Maximum length is 128. (Source: MSSQLServer, Error number:
> 103)
> Get help: http://help/103
>
Merge Replication Schema Sync Problems
I am using a merge publication set to synchronize schema changes. Why am I getting the following message when I try to sync after having added columns in the publication database using ALTER TABLE statements?
The schema definition of the destination table ... in the subscription database does not match the schema definition of the source table in the publication database. Reinitialize the subscription without a snapshot after ensuring that the schema definition of the destination table is the same as the source table.
Also, why doesn't reinitializing the subscription with @.upload_first = false not fix the problem?
I have encountered this problem with both merge replication and with transactional replication
When you add columns at the publisher they do not always get published correctly. You can check in the GUI for the properties of the article and will sometimes see that the new columns are not checked.
I have found that it is necessary to either use the GUI or TSQL to explicitly add the missing columns to the publication. If you have tried to merge resync before doing this then I think that you will need to reinitialise your subscriptions
In my experience this behaviour seems to happen frequently with transactional replication, but only occasionally with merge replication
reinit with upload first won't fix the problem if the merge is attempting to synchronize and enumerate data changes with different schemas on the publisher and subscriber
aero1
Merge Replication Question
When I create the publication (SQL 2000) I have to execute the following shell command to get the snapshot created:
Set @.cmd = 'c:\Progra~1\Micros~2\80\Com\snapshot -Publisher ' + @.DBServer + ' -PublisherDB ' + @.Database + ' -Publication ' + Cast(@.publication as varchar(100)) + ' -Distributor ' + @.DBServer + ' -DistributorLogin ' + @.DBUserName + ' -DistributorPassword ' + @.DBPassword + ' -ReplicationType 2'
EXEC master..xp_cmdshell @.cmd;
problem is the following:
Creating Snapshot took 14:24
Here's the log of the entire process:
Finding Publication took 0:09
About to Create Publication
Creating Publication took 0:13
About to Add Aritcles
Adding articles took 0:09
About to define filters
Defining filters took 0:11
About to Add Snapshot Agent
Adding snapshot agent took 0:01
About to Execute command to start snapshot agent
(339 row(s) affected)
Creating Snapshot took 14:24
My question is, is there a way to speed this up?
Look at the history tables to see if there's a breakdown to see where the time is being spent. If not there, then add the following parameters to the above: -HistoryVerboseLevel 2 -OutputVerboseLevel 3. This should generate more output as well as log more history in distribution.dbo.MSmerge_history.
At the same time, you didn't mention how big the snapshot is, or how fast/slow your disk subsystem is. That definitely coudl play a part in performrance.
Wednesday, March 21, 2012
Merge Replication Push using IP address fails? WTF?
I have a Merge publication that has multiple subscribers. They are all SQL Express, so it's all Push Subscriptions.
When I try to add a subscriber by it's IP address, the snapshot gets delivered. Schema created, data loaded, but I see the following error in Replication Monitor:
The merge process was unable to deliver the snapshot to the Subscriber. If using Web synchronization, the merge process may have been unable to create or write to the message file. When troubleshooting, restart the synchronization with verbose history logging and specify an output file to which to write. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201001)
Cannot find the object 'MSmerge_ctsv_E0801EECCA824BB29D48D36D64D2BAEA', because it does not exist or you do not have permission. (Source: MSSQLServer, Error number: 15151)
When I change the IP address in the script to the name of the machine it works perfectly. The ONLY thing I changed in the script was the IP address to the name.
The reason for this is that I have several client machines that will have connectivity, but NO name resolution back at the Server.
Please, Please, Please help!
Sample follows:
Code Snippet
execsp_addmergesubscription
@.publication = N'TestPub',
@.subscriber = N'10.126.22.30',
@.subscriber_db = N'dbTest',
@.subscription_type = N'Push',
@.sync_type = N'Automatic',
@.subscriber_type = N'Local',
@.subscription_priority = 0,
@.description =null,
@.use_interactive_resolver = N'False'
execsp_addmergepushsubscription_agent
@.publication = N'TestPub',
@.subscriber = N'10.126.22.30',
@.subscriber_db = N'dbTest',
@.job_login =null, @.job_password =null,
@.subscriber_security_mode = 0,
@.subscriber_login = N'Valid SQL LOGIN',
@.subscriber_password = N'ValidPassword',
@.publisher_security_mode = 1,
@.frequency_type = 64,
@.frequency_interval = 0,
@.frequency_relative_interval = 0,
@.frequency_recurrence_factor = 0,
@.frequency_subday = 0,
@.frequency_subday_interval = 0,
@.active_start_time_of_day = 0,
@.active_end_time_of_day = 235959,
@.active_start_date = 20070607,
@.active_end_date = 99991231,
@.enabled_for_syncmgr = N'False'
Pushing to an IP address is not supported. No doubt that is why it is failing. You must push to the server name. However you can setup an Alias and push to that. I think the Alias must match the server name.
I did read somewhere that Aliases may not be supported either but I know that does work. You could also consider adding entries to your hosts file.
Martin
|||DOH!
Thanks for the reply.
I really HATE having to edit the hosts file......
Merge Replication Problems
I have a problem by using GPRS in a merge replication.
I have an SQL Servers with 4 publications, these publication have horizontal
filtering, and they have about 20 Articles each of them. I need the
horizontal filtering because the client databases (client laptops use MSDE)
only needs to have the required data.
If I run the replication by using the office network, all of then works
fine. But my problem is by running the replication using GPRS. I have lot of
problems because the connection is broken although there isn't data to be
merged.
Thanks in advance
If the network error is a problem causing the merge agent to fail, then you
can force it to restart: the last step in the merge job should be to return
to step one if it fails.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Hi Paul,
Automatically is retrying the agent execution, Exactly the error is "General
network error", it seems the connection with distributor is broken when there
is data to be downloaded.
There is any guide to optimize correctly a publication.
I also have change the replication schema, I have configurated an
intermediate database to obtain the required data by a client, and after i
have configurated this database as publiser to send the data to the client
without filters, but when I try to send this data to the client the
replication log says "there isn't data to be downloaded". It is possible to
configure this topology? or it is an erroneus design?
Topology:
ServerDB (publisher) --> Inter.DB (Subscriber/Publisher) --> clientDB
(Subscriber)
Thanks.
|||Please, could anybody help me?
Thanks
|||For the unreliable agent, apart from creating the loop I
referred to earlier, you could change the merge agent's
profile properties to
optimize for an unreliable link - eg reduce
the '...GenerationsPerBatch'
counters.
For the topology, this is vaible and is referred to as
republishing. If you're having issues with it, then
perhaps go down the alternative synchronization partners
route.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||I have tried to configured the new topology:
ServerDB (publisher) --> Inter.DB (Subscriber/Publisher) --> clientDB
(Subscriber)
But always after I execute the subscription at ClientDB, it says "no data to
be merged", but i have modified data in the Serverdb that has been merged to
the InterDB. I don't understand why. Any idea?
Thanks.
|||OK - I just set this up in the office and it worked fine.
Perhaps you have been put off by the message 'No data
needed to be merged'? This message is the last one to be
recorded and is displayed even when the data has indeed
been merged. Please right-click the merge agent for the
clientDB subscription and examine its history to
determine if the changes really went over.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||I have checked the job history, but no data has been trasfered. I have open
tables, but there isn't data.
|||Please can you script it out - the table schema and the 2
publications and subscribers and post it up and I'll take
a look some time tomorrow.
Rgds,
Paul Ibison
|||Table:
CREATE TABLE [dbo].[MST_MANDANTE] (
[ID_CODMANDANTE] [varchar] (3) COLLATE Modern_Spanish_CI_AS NOT NULL ,
[TXT_DESCRIPCION] [varchar] (20) COLLATE Modern_Spanish_CI_AS NULL ,
[ID_CONTROL] uniqueidentifier ROWGUIDCOL NOT NULL
) ON [PRIMARY]
GO
Publication ServerDB:
-- Enabling the replication database
use master
GO
exec sp_replicationdboption @.dbname = N'SFAservidor', @.optname = N'merge
publish', @.value = N'true'
GO
use [SFAservidor]
GO
-- Adding the merge publication
exec sp_addmergepublication @.publication = N'SFAservidorMandante',
@.description = N'Merge publication of SFAservidor database from Publisher
PCSAC02.', @.retention = 14, @.sync_mode = N'native', @.allow_push = N'true',
@.allow_pull = N'true', @.allow_anonymous = N'false', @.enabled_for_internet =
N'false', @.centralized_conflicts = N'true', @.dynamic_filters = N'false',
@.snapshot_in_defaultfolder = N'false', @.alt_snapshot_folder = N'd:\snapshot',
@.compress_snapshot = N'false', @.ftp_port = 21, @.ftp_login = N'anonymous',
@.conflict_retention = 14, @.keep_partition_changes = N'false',
@.allow_subscription_copy = N'false', @.allow_synctoalternate = N'false',
@.add_to_active_directory = N'false', @.max_concurrent_merge = 0,
@.max_concurrent_dynamic_snapshots = 0
exec sp_addpublication_snapshot @.publication =
N'SFAservidorMandante',@.frequency_type = 4, @.frequency_interval = 1,
@.frequency_relative_interval = 1, @.frequency_recurrence_factor = 0,
@.frequency_subday = 1, @.frequency_subday_interval = 5, @.active_start_date =
0, @.active_end_date = 0, @.active_start_time_of_day = 500,
@.active_end_time_of_day = 235959, @.snapshot_job_name =
N'PCSAC02-SFAservidor-SFAservidorMandante-21'
GO
exec sp_grant_publication_access @.publication = N'SFAservidorMandante',
@.login = N'BUILTIN\Administradores'
GO
exec sp_grant_publication_access @.publication = N'SFAservidorMandante',
@.login = N'distributor_admin'
GO
exec sp_grant_publication_access @.publication = N'SFAservidorMandante',
@.login = N'sa'
GO
-- Adding the merge articles
exec sp_addmergearticle @.publication = N'SFAservidorMandante', @.article =
N'MST_MANDANTE', @.source_owner = N'dbo', @.source_object = N'MST_MANDANTE',
@.type = N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause = null,
@.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
Publication InterDB:
-- Enabling the replication database
use master
GO
exec sp_replicationdboption @.dbname = N'SFAInt', @.optname = N'merge
publish', @.value = N'true'
GO
use [SFAInt]
GO
-- Adding the merge publication
exec sp_addmergepublication @.publication = N'SFAIntMandante', @.description =
N'Merge publication of SFAInt database from Publisher PCSAC02.', @.retention =
14, @.sync_mode = N'native', @.allow_push = N'true', @.allow_pull = N'true',
@.allow_anonymous = N'false', @.enabled_for_internet = N'false',
@.centralized_conflicts = N'true', @.dynamic_filters = N'false',
@.snapshot_in_defaultfolder = N'false', @.alt_snapshot_folder = N'd:\snapshot',
@.compress_snapshot = N'false', @.ftp_port = 21, @.ftp_login = N'anonymous',
@.conflict_retention = 14, @.keep_partition_changes = N'false',
@.allow_subscription_copy = N'false', @.allow_synctoalternate = N'false',
@.add_to_active_directory = N'false', @.max_concurrent_merge = 0,
@.max_concurrent_dynamic_snapshots = 0
exec sp_addpublication_snapshot @.publication =
N'SFAIntMandante',@.frequency_type = 8, @.frequency_interval = 64,
@.frequency_relative_interval = 0, @.frequency_recurrence_factor = 1,
@.frequency_subday = 1, @.frequency_subday_interval = 0, @.active_start_date =
0, @.active_end_date = 0, @.active_start_time_of_day = 5000,
@.active_end_time_of_day = 0, @.snapshot_job_name =
N'PCSAC02-SFAInt-SFAIntMandante-27'
GO
exec sp_grant_publication_access @.publication = N'SFAIntMandante', @.login =
N'BUILTIN\Administradores'
GO
exec sp_grant_publication_access @.publication = N'SFAIntMandante', @.login =
N'distributor_admin'
GO
exec sp_grant_publication_access @.publication = N'SFAIntMandante', @.login =
N'sa'
GO
-- Adding the merge articles
exec sp_addmergearticle @.publication = N'SFAIntMandante', @.article =
N'MST_MANDANTE', @.source_owner = N'dbo', @.source_object = N'MST_MANDANTE',
@.type = N'table', @.description = null, @.column_tracking = N'true',
@.pre_creation_cmd = N'drop', @.creation_script = null, @.schema_option =
0x000000000000CFF1, @.article_resolver = null, @.subset_filterclause = null,
@.vertical_partition = N'false', @.destination_owner = N'dbo',
@.auto_identity_range = N'false', @.verify_resolver_signature = 0,
@.allow_interactive_resolver = N'false', @.fast_multicol_updateproc = N'true',
@.check_permissions = 0
GO
Subscription InterDB:
-- Adding the merge pull subscription: PCSAC02:SFAservidor:SFAservidorMandante
/****** Begin: Script to be run at Subscriber: PCSAC02 ******/
use [SFAInt]
GO
exec sp_addmergepullsubscription @.publication = N'SFAservidorMandante',
@.publisher = N'PCSAC02', @.publisher_db = N'SFAservidor', @.subscriber_type =
N'global', @.subscription_priority = 75.000000, @.sync_type = N'none',
@.description = N'Merge publication of SFAservidor database from Publisher
PCSAC02.'
exec sp_addmergepullsubscription_agent @.publisher = N'PCSAC02',
@.publisher_db = N'SFAservidor', @.publication = N'SFAservidorMandante',
@.distributor = N'PCSAC02', @.subscriber_security_mode = 1,
@.publisher_security_mode = 1, @.distributor_security_mode = 1, @.frequency_type
= 4, @.frequency_interval = 1, @.frequency_relative_interval = 1,
@.frequency_recurrence_factor = 0, @.frequency_subday = 8,
@.frequency_subday_interval = 1, @.active_start_date = 0, @.active_end_date = 0,
@.active_start_time_of_day = 0, @.active_end_time_of_day = 235959,
@.enabled_for_syncmgr = N'true', @.alt_snapshot_folder = N'\\pcsac02\snapshot',
@.use_ftp = N'false', @.use_interactive_resolver = N'false', @.offloadagent =
N'false'
GO
/****** End: Script to be run at Subscriber: PCSAC02 ******/
/****** Begin: Script to be run at Publisher: PCSAC02 ******/
use [SFAservidor]
GO
exec sp_addmergesubscription @.publication = N'SFAservidorMandante',
@.subscriber = N'PCSAC02', @.subscriber_db = N'SFAInt', @.subscription_type =
N'pull', @.subscriber_type = N'global', @.subscription_priority = 75.000000,
@.sync_type = N'none'
GO
/****** End: Script to be run at Publisher: PCSAC02 ******/
Subscription ClienDB:
-- Adding the merge pull subscription: PCSAC02:SFAInt:SFAIntMandante
/****** Begin: Script to be run at Subscriber: PCSAC02 ******/
use [sfacliente]
GO
exec sp_addmergepullsubscription @.publication = N'SFAIntMandante',
@.publisher = N'PCSAC02', @.publisher_db = N'SFAInt', @.subscriber_type =
N'local', @.subscription_priority = 0.000000, @.sync_type = N'none',
@.description = N'Merge publication of SFAInt database from Publisher PCSAC02.'
exec sp_addmergepullsubscription_agent @.publisher = N'PCSAC02',
@.publisher_db = N'SFAInt', @.publication = N'SFAIntMandante', @.distributor =
N'PCSAC02', @.subscriber_security_mode = 1, @.publisher_security_mode = 1,
@.distributor_security_mode = 1, @.frequency_type = 4, @.frequency_interval = 1,
@.frequency_relative_interval = 1, @.frequency_recurrence_factor = 0,
@.frequency_subday = 8, @.frequency_subday_interval = 1, @.active_start_date =
0, @.active_end_date = 0, @.active_start_time_of_day = 0,
@.active_end_time_of_day = 235959, @.enabled_for_syncmgr = N'true',
@.alt_snapshot_folder = N'\\pcsac02\snapshot', @.use_ftp = N'false',
@.use_interactive_resolver = N'false', @.offloadagent = N'false'
GO
/****** End: Script to be run at Subscriber: PCSAC02 ******/
/****** Begin: Script to be run at Publisher: PCSAC02 ******/
use [SFAInt]
GO
exec sp_addmergesubscription @.publication = N'SFAIntMandante', @.subscriber =
N'PCSAC02', @.subscriber_db = N'sfacliente', @.subscription_type = N'pull',
@.subscriber_type = N'local', @.subscription_priority = 0.000000, @.sync_type =
N'none'
GO
/****** End: Script to be run at Publisher: PCSAC02 ******/