Monday, March 19, 2012

Force Data - Merge Replication

I thought I could force data to be sent on the next merge by doing a simple
update statement on the rows I need sent.
Ran update statement at the subscriber
Update MyTable
SET A_Column = A_Column
This doesn't seem to work for rows that don't already exist on the
publisher.
Is there a system stored procedure that I can use at the subscriber to force
some data to the publisher?
Tina,
sp_mergedummyupdate should do it for you.
HTH,
Paul Ibison (SQL Server MVP)
[vbcol=seagreen]
|||The system stored procedure doesn't seem to force the rows to be sent
either.
I wrote the following since I had several hundred rows to force. I ran
the agent afer running the script but still no rows were inserted.
DECLARE @.guid uniqueidentifier
DECLARE @.SQL nvarchar(200)
DECLARE list_procs CURSOR FOR
SELECT row_guid FROM Ticket
OPEN list_procs
FETCH NEXT FROM list_procs INTO @.guid
WHILE @.@.FETCH_STATUS = 0
BEGIN
SELECT @.SQL = 'sp_mergedummyupdate @.source_object = ''Ticket''' +
',@.rowguid=''{' + CONVERT( varchar(36), @.guid ) + '}'''
--Print @.SQL
EXEC sp_executesql @.sql
FETCH NEXT FROM list_procs INTO @.guid
END
CLOSE list_procs
DEALLOCATE list_procs
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:u$GZGwisEHA.904@.TK2MSFTNGP11.phx.gbl...
> Tina,
> sp_mergedummyupdate should do it for you.
> HTH,
> Paul Ibison (SQL Server MVP)
>
>
|||Tina,
can you check (based on rowguid) to see if the records have entered
MSmerge_contents. Also, I don't want to state the obvious, but did you run
the merge agent afterwards?
Rgds,
Paul ibison (SQL Server MVP)
[vbcol=seagreen]
|||I figured out my problem. I found that the rowguids were in my
msmerge_tombstone table. Since I was using a push, the publisher could
never delete them from the subscriber but replication wasn't letting the
subscriber send these as new rows either.
Thanks for your time.
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:Oy$1XUFtEHA.3052@.tk2msftngp13.phx.gbl...
> Tina,
> can you check (based on rowguid) to see if the records have entered
> MSmerge_contents. Also, I don't want to state the obvious, but did you run
> the merge agent afterwards?
> Rgds,
> Paul ibison (SQL Server MVP)
>
>

No comments:

Post a Comment