无法在复制表上更新/插入
我在 SQL Server 上定义了表的单向发布。 在订阅者端(SQL Compact),我需要能够检索表的内容并修改它们,但这些修改不得发送回发布者。有时,必须使用发布者的更新版本重新初始化表的内容,删除本地所做的所有修改。我不关心可能出现的任何冲突,因为数据不会发送回服务器。
问题是我无法更新/插入/删除表中的任何行,除非我将表发布为“双向”,这不是我想要的。当尝试更新此表(在客户端)时,出现以下错误:
SSCE_M_READONLY “执行 RDA 推送时,SQL Server Compact 只能获取推送到 SQL Server 的表上的只读游标。尝试推送时,SQL Server 上可能存在锁定冲突。请验证SQL Server 上的表可更新并重试。”
所以基本上,我想要的是:
- 从服务器获取数据
- 处理数据(插入/更新/删除)
- 删除所有修改的行
- 同步表(从服务器获取“干净”版本)
我不想重新- 同步时下载表的所有内容,但这不是必须的。
I have defined a unidirectional publication of a table on SQL Server.
On the subscriber side(SQL Compact), I need to be able to retrieve the contents of the table and modify them, BUT these modifications must NOT be sent back to the publisher. From time to time, the contents of the table must be reinitialized with the updated version from the publisher, dropping all the modifications that were made locally. I do not care about any conflicts that can arise, as the data will not be sent back to the server.
The problem is that I cannot Update/Insert/Delete any rows in the table, unless I publish the table as "bidirectional", which is not what I want. When trying an update on this table(on the client side), I get the following error:
SSCE_M_READONLY
"While performing an RDA Push, SQL Server Compact was only able to obtain a read-only cursor on the table(s) being pushed to SQL Server. There could be locking conflicts on SQL Server while trying to do the push. Verify that the table on SQL Server is updatable and try again."
So basically, what I want is:
- get the data from the server
- work on the data(insert/update/delete)
- delete all modified rows
- synchronize the table(get a 'clean' version from the server)
I'd prefer not to re-download all the contents of the table when synchronizing, but this is not a MUST.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
复制就是为了维护发布者和订阅者之间数据的一致性,所以我想说你不想在你的情况下使用它。
设置一个可以定期运行的 SSIS 包怎么样?它将进行查找并插入新行,并将现有行重置回发布者为其提供的任何行。类似于此处描述的内容:
http: //beingoyen.blogspot.com/2010/03/ssis-how-to-update-instead-of-insert.html
Replication is all about maintaining consistency of the data between Publisher and Subscriber so I would say you don't want to use it in your situation.
What about setting up an SSIS package that you could run periodically? It would do a lookup and insert new rows and reset existing rows back to whatever the publisher has for them. Similar to what's described here:
http://beingoyen.blogspot.com/2010/03/ssis-how-to-update-instead-of-insert.html