什么是SQL Server中的syncobj [英] What is syncobj in SQL Server

查看:203
本文介绍了什么是SQL Server中的syncobj的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行此脚本以搜索 sys.columns 中的特定文本时,我得到很多 dbo.syncobj_0x3934443438443332 像行。

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%'

如果我理解正确,它们就是复制对象。是这样吗?我可以像 o.name那样将它们从查询中丢弃吗?不喜欢'%syncobj%'还是有另一种方法?

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?

谢谢。

推荐答案

我找到了解决方案。

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'

结果现在很好。正如我说过的,syncobj是复制对象,对我们没有意义。它们仅用于复制目的。

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

编辑:

忘了添加,syncobj是以视图的形式存储在数据库中的,因此,如果您需要视图列表,则可能需要像我一样忽略它们我的问题。

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和我的视图之间的差异时,唯一的差异是 is_ms_shipped 列。对于syncobj,它是1,对于其他人,则是0。这意味着syncobj视图是由系统创建的。

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。我将等待一段时间,如果没有人提供其他答案,我会接受我的。

P.S. I'll wait for some time and if nobody gives another answer, I'll accept mine.

这篇关于什么是SQL Server中的syncobj的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆