When I run this script to search particular text in sys.columns
and I get a lot of "dbo.syncobj_0x3934443438443332"
like rows.
当我运行这个脚本来搜索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%'
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?
如果我做对了,它们就是复制对象。是这样吗?我可以把它们从我的查询中删除,就像o.name NOT LIKE'%syncobj%'或者还有另一种方法吗?
Thank you.
谢谢。
2 个解决方案
#1
11
I've found a solution. Doesn't know, if it's the best one or not.
我找到了解决方案。不知道,如果它是最好的一个。
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%' AND o.type = 'U'
The result is fine now. As I said syncobj's are replication objects and they doesn't have meaning for us. They're used for replication purposes only.
结果很好。正如我所说,syncobj是复制对象,它们对我们没有意义。它们仅用于复制目的。
http://www.developmentnow.com/g/114_2007_12_0_0_443938/syncobj-views.htm
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.
忘记添加,syncobj作为视图存储在DB中,所以如果你需要视图列表,你可能需要像我在我的问题中那样忽略它们。
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.
在检查syncobj和我的视图之间的区别时,唯一的区别是is_ms_shipped列。对于syncobj,它为1,对于其他0。这意味着syncobj视图由系统创建。
P.S. I'll wait for some time and if nobody gives another answer, I'll accept mine.
附:我会等一段时间,如果没有人给出另一个答案,我会接受我的。
#2
2
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.
创建不包含原始表中的所有字段或其他元数据更改的复制时。如果您从发布中执行生成脚本,它将显示它是如何创建的(请参见下文)。该视图提供了一个在初始快照期间生成bcp提取的对象。
Here is an example
这是一个例子
-- Adding the article synchronization object exec sp_articleview @publication = N'publication_data', @article = N'tablename', @view_name = N'syncobj_0x4239373642443436', @filter_clause = N'', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1 GO
- 添加文章同步对象exec sp_articleview @publication = N'publication_data',@ article = N'tablename',@ view_name = N'syncobj_0x4239373642443436',@ filter_clause = N'',@ force_invalidate_snapshot = 1,@ force_reinit_subscription = 1 GO
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
附:我最近遇到了一个问题,当我删除复制时,它无法丢弃这些,然后你必须手动删除系统视图以重用复制脚本。给出错误消息
Msg 2714, Level 16, State 3: There is already an object named 'syncobj_0x3437324238353830' in the database.
消息2714,级别16,状态3:数据库中已存在名为“syncobj_0x3437324238353830”的对象。
Which caused the bcp to fail during the snapshot.
这导致bcp在快照期间失败。
#1
11
I've found a solution. Doesn't know, if it's the best one or not.
我找到了解决方案。不知道,如果它是最好的一个。
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%' AND o.type = 'U'
The result is fine now. As I said syncobj's are replication objects and they doesn't have meaning for us. They're used for replication purposes only.
结果很好。正如我所说,syncobj是复制对象,它们对我们没有意义。它们仅用于复制目的。
http://www.developmentnow.com/g/114_2007_12_0_0_443938/syncobj-views.htm
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.
忘记添加,syncobj作为视图存储在DB中,所以如果你需要视图列表,你可能需要像我在我的问题中那样忽略它们。
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.
在检查syncobj和我的视图之间的区别时,唯一的区别是is_ms_shipped列。对于syncobj,它为1,对于其他0。这意味着syncobj视图由系统创建。
P.S. I'll wait for some time and if nobody gives another answer, I'll accept mine.
附:我会等一段时间,如果没有人给出另一个答案,我会接受我的。
#2
2
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.
创建不包含原始表中的所有字段或其他元数据更改的复制时。如果您从发布中执行生成脚本,它将显示它是如何创建的(请参见下文)。该视图提供了一个在初始快照期间生成bcp提取的对象。
Here is an example
这是一个例子
-- Adding the article synchronization object exec sp_articleview @publication = N'publication_data', @article = N'tablename', @view_name = N'syncobj_0x4239373642443436', @filter_clause = N'', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1 GO
- 添加文章同步对象exec sp_articleview @publication = N'publication_data',@ article = N'tablename',@ view_name = N'syncobj_0x4239373642443436',@ filter_clause = N'',@ force_invalidate_snapshot = 1,@ force_reinit_subscription = 1 GO
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
附:我最近遇到了一个问题,当我删除复制时,它无法丢弃这些,然后你必须手动删除系统视图以重用复制脚本。给出错误消息
Msg 2714, Level 16, State 3: There is already an object named 'syncobj_0x3437324238353830' in the database.
消息2714,级别16,状态3:数据库中已存在名为“syncobj_0x3437324238353830”的对象。
Which caused the bcp to fail during the snapshot.
这导致bcp在快照期间失败。