What is syncobj in SQL Server

hgulyan picture hgulyan · May 26, 2010 · Viewed 7.8k times · Source

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.

Answer

hgulyan picture hgulyan · May 26, 2010

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 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.