合并复制的基本操作我在这里就不多说了, 很多地方都能找到。
以下是几点是这几天研究同的经验。
1. 合并复制如果加了筛选条件时是不允许双向的, 数据只能从发布同步到订阅, 如果你在订阅端插入数据会出错。
2. 错误
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)
Get help: http://help/MSSQL_REPL-2147201001
The process could not bulk copy into table '"dbo"."Complaint"'. (Source: MSSQL_REPL, Error number: MSSQL_REPL20037)
Get help: http://help/MSSQL_REPL20037
Field size too large (Source: MSSQLServer, Error number: 0)
Get help: http://help/0
To obtain an error file with details on the errors encountered when initializing the subscribing table, execute the bcp command that appears below. Consult the BOL for more information on the bcp utility and its supported options. (Source: MSSQLServer, Error number: 20253)
Get help: http://help/20253
bcp "mpnet"."dbo"."Complaint" in "E:\RepData\unc\myserver\20100407171022\Complaint_17.bcp" -e "errorfile" -t"\n<x$3>\n" -r"\n<,@g>\n" -m10000 -Smysubserver\MP -T -w (Source: MSSQLServer, Error number: 20253)
Get help:
http://help/20253
是因为在varchar/char/text 中(ASCII)存有特殊字符,当代理要产生BCP文件时会出错 ,需要改为nvarchar/nchar/ntext (unicode)
3. 对于大表时可以采用手动