SQL Server 中的syncobj是什么
当我运行此脚本来搜索 sys.columns 中的特定文本时,我得到很多类似行的“dbo.syncobj_0x3934443438443332”。
SELECT c.name, s.name + '.' + o.name
FROM sys.columns c
INNER JOIN sys.objects o ON c.object_id=o.object_id
INNER JOIN sys.schemas s ON o.schema_id=s.schema_id
WHERE c.name LIKE '%text%'
如果我没猜错的话,它们就是复制对象。是这样吗?我可以像 o.name NOT LIKE '%syncobj%'
一样将它们从查询中丢弃吗?或者还有其他方法吗?
谢谢。
When I run this script to search particular text in sys.columns
and I get a lot of "dbo.syncobj_0x3934443438443332"
like rows.
SELECT c.name, s.name + '.' + o.name
FROM sys.columns c
INNER JOIN sys.objects o ON c.object_id=o.object_id
INNER JOIN sys.schemas s ON o.schema_id=s.schema_id
WHERE c.name LIKE '%text%'
If I get it right, they are replication objects. Is it so? Can i just throw them away from my query just like o.name NOT LIKE '%syncobj%'
or there's another way?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我找到了解决方案。不知道是不是最好的。
现在的结果已经很好了。正如我所说,syncobj 是复制对象,它们对我们来说没有任何意义。它们仅用于复制目的。
http://www.developmentnow.com/g/114_2007_12_0_0_443938/syncobj-views。 htm
编辑:
忘记添加,syncobj 作为视图存储在数据库中,因此如果您需要视图列表,您可能需要像我在问题中那样忽略它们。
在检查syncobj和我的视图之间的差异时,唯一的区别是is_ms_shipped列。对于syncobj,它是1,对于其他的,它是0。这意味着syncobj视图是由系统创建的。
PS我会等待一段时间,如果没有人给出另一个答案,我会接受我的。
I've found a solution. Doesn't know, if it's the best one or not.
The result is fine now. As I said syncobj's are replication objects and they don't have a meaning for us. They're used for replication purposes only.
http://www.developmentnow.com/g/114_2007_12_0_0_443938/syncobj-views.htm
EDIT:
Forgot to add, syncobj's are stored in DB as Views, so if you need list of views, you'll probably need to ignore them as I did in my question.
While checking difference between syncobj's and my views, the only difference is is_ms_shipped column. For syncobj it's 1, for others 0. It means that syncobj views are created by system.
P.S. I'll wait for some time and if nobody gives another answer, I'll accept mine.
当您创建不包含原始表中的所有字段或其他元数据更改的复制时。如果您从出版物生成脚本,它将向您显示它是如何创建的(见下文)。该视图提供一个对象来在初始快照期间生成 bcp 提取。
这是一个例子
@force_invalidate_snapshot = 1,@ force_reinit_subscription 最近,当我删除复制时,我遇到了一个问题,它无法删除这些复制,然后您必须手动删除系统视图才能重用复制脚本。给出错误信息
这导致 bcp 在快照期间失败。
When you create a replication that does not include all the fields or other meta data changes from the original table. If you do a generate script from a publication it will show you how it is created (see below). The view provide a object to generate the bcp extracts during the initial snapshots.
Here is an example
P.S. I recently had a problem when the I dropped replication, it failed to drop these and then you have to manually drop the system views to reuse a replication script. Giving a error message
Which caused the bcp to fail during the snapshot.