Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
squarefish
Starting Member
28 Posts |
Posted - 2009-09-25 : 03:27:30
|
Hi there,I'm having a problem with my merge replication project. I import about 500 rows of data each night via an SSIS package, but this data does not get added to the subscription.I found an article that explained the problem, but I'm not sure how to implement the fix?Here is the article, can anyone help?ThanksRichardquote: This can happen in 2 circumstances: (1) If you bulk insert the rows and accept the defaults, then "FIRE_TRIGGERS" is false and consequently the rows are not added to MSmerge_contents. (2) If you do a fast-load using the Transform Data task in DTS/SSIS. In all cases you need to run sp_addtabletocontents to include the rows and then resynchronise. Alternatively you can use sp_mergedummyupdate for a single row. For the fast load case, in future if you deselect the check box in the SSIS/DTS data flow, the merge insert trigger will fire. sp_addtabletocontents (Transact-SQL)Inserts references into the merge tracking tables for any rows in a source table that are not currently included in the tracking tables. Use this option if you have bulk-loaded a large amount of data using bcp, which will not fire merge tracking triggers. This stored procedure is executed at the Publisher on the publication database.Transact-SQL Syntax Conventions Syntax sp_addtabletocontents [ @table_name = ] 'table_name' [ , [ @owner_name = ] 'owner_name' ] [ , [ @filter_clause = ] 'filter_clause' ] Arguments [ @table_name=] 'table_name' Is the name of the table. table_name is sysname, with no default.[ @owner_name=] 'owner_name' Is the name of the owner of the table. owner_name is sysname, with a default of NULL.[ @filter_clause = ] 'filter_clause' Specifies a filter clause that controls which rows of the newly-loaded data should be added to the merge tracking tables. filter_clause is nvarchar(4000), with a default value of NULL. If filter_clause is null, all bulk loaded rows are added. Return Code Values 0 (success) or 1 (failure) Remarks sp_addtabletocontents is used only in merge replication. The rows in the table_name are referred to by their rowguidcol and the references are added to the merge tracking tables. sp_addtabletocontents should be used after bulk copying data into a table that is published using merge replication. The stored procedure initiates tracking of the rows that were copied and ensures that the new rows will be included in the next synchronization. Permissions Only members of the sysadmin fixed server role or db_owner fixed database role can execute sp_addtabletocontents.
|
|
|
|
|
|
|