复制 - 用户定义的表类型不会传播到订阅者
我创建了一个名为 tvp_Shipment 的用户定义表类型,其中包含两列(id 和 name)。生成了一个快照,并且用户定义的表类型已正确传播到所有订阅者。
我在存储过程中使用了这个 tvp,一切正常。
然后我想再向该表值参数添加一列created_date。我删除了存储过程(也从复制中删除),还删除并重新创建了包含 3 列的用户定义表类型,然后重新创建了存储过程并启用它进行发布
当我生成新快照时,用户定义的表类型中的更改不会传播到订阅者。新添加的列未添加到订阅中。
错误消息:
The schema script 'usp_InsertAirSa95c0e23_218.sch' could not be propagated to the subscriber. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201001)
Get help: http://help/MSSQL_REPL-2147201001
Invalid column name 'created_date'. (Source: MSSQLServer, Error number: 207)
Get help: http://help/207
I created a User defined table type named tvp_Shipment with two columns (id and name) . generated a snapshot and the User defined table type was properly propagated to all the subscribers.
I was using this tvp in a stored procedure and everything worked fine.
Then I wanted to add one more column created_date to this table valued parameter.I dropped the stored procedure (from replication too) and also i dropped and recreated the User defined table type with 3 columns and then recreated the stored procedure and enabled it for publication
When I generate a new snapshot, the changes in user defined table type are not propagated to the subscriber. The newly added column was not added to the subscription.
the Error messages:
The schema script 'usp_InsertAirSa95c0e23_218.sch' could not be propagated to the subscriber. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201001)
Get help: http://help/MSSQL_REPL-2147201001
Invalid column name 'created_date'. (Source: MSSQLServer, Error number: 207)
Get help: http://help/207
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在发布中,replicate_ddl 选项是否设置为 true?另外,相关文章的 pre_cmd 值是多少?如果这些都没有为您指明正确的方向,请查看它所说的失败文件。它应该是一个人类可读的 T-SQL 文件,位于分发服务器的快照文件夹中。如果错误不明显,您可以尝试在订阅者上运行它,看看它会给出什么结果。我的猜测是它没有复制列更改,但您在其上放置了引用该列的索引。但这只是一个猜测。
On the publication, is the replicate_ddl option set to true? Also, what's the value for the pre_cmd value for the article in question? If neither of those point you in the right direction, take a look at the file that it says is failing. It should be a human-readable T-SQL file that's located at the distributor in the snapshot folder. If the error isn't obvious, you can try running it at the subscriber and see what it gives you. My guess is that it didn't replicate the column change, but you put an index on it which references that column. But that's just a guess.