- posted
16 years ago
Hi Math, This is akber as promosie please have this script saved on the any notepad and name is mergedata.sql
-- Enabling the replication database use master GO
exec sp_replicationdboption @dbname = N'gesboutm', @optname = N'merge publish', @value = N'true' GO
use [gesboutm] GO
-- Adding the merge publication exec sp_addmergepublication @publication = N'gesboutm_Repl', @description N'Merge publication of gesboutm database from Publisher RMS_STORE2.', @retention = 0, @sync_mode N'character', @allow_push = N'true', @allow_pull = N'true', @allow_anonymous = N'true', @enabled_for_internet = N'false', @centralized_conflicts N'true', @dynamic_filters N'false', @snapshot_in_defaultfolder = N'true', @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'gesboutm_Repl',@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'RMS_STORE2-gesboutm-gesboutm_Repl-1' GO
exec sp_grant_publication_access @publication = N'gesboutm_Repl', @login N'BUILTIN\Administrators' GO exec sp_grant_publication_access @publication = N'gesboutm_Repl', @login N'distributor_admin' GO exec sp_grant_publication_access @publication = N'gesboutm_Repl', @login N'sa' GO
-- Adding the merge articles exec sp_addmergearticle @publication = N'gesboutm_Repl', @article N'ItemPrix', @source_owner = N'dbo', @source_object = N'ItemPrix', @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'true', @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
-- Adding the article's partition column(s) exec sp_mergearticlecolumn @publication = N'gesboutm_Repl', @article N'ItemPrix', @column = N'XXXXX', @operation = N'add' GO
-- Repeat the above for all columsn in tables
-- Adding the merge articles exec sp_addmergearticle @publication = N'gesboutm_Repl', @article N'ItemPrixRemise', @source_owner = N'dbo', @source_object = N'Voucher', @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'true', @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
exec sp_mergearticlecolumn @publication = N'gesboutm_Repl', @article N'ItemPrixRemise', @column = N'XXXXX', @operation = N'add' GO
-- Repeat the above for all columsn in tables
-- Adding the merge subscription exec sp_addmergesubscription @publication = N'gesboutm_Repl', @subscriber N'AURES_1542', @subscriber_db = N'RMS_OFF', @subscription_type = N'push', @subscriber_type = N'local',
@subscription_priority = 0.000000, @sync_type = N'none', @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'false', @offloadagent = 0, @use_interactive_resolver = N'false' GO
Also remember above I just added the example of one column of each tables you send to me. there are some other stuff can be done also. I better suggest that I have remote client RDP and will connect to your server to serve you. if you want.
Let me know if require any more help.
"Math" wrote:
I thank you, I suspected that it was necessary to use a publication but I was not on.
I used your script and that works very decently after some modification.
Thank you.
Math
"Akber Alwani" wrote:
@type
BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.