views:

115

answers:

1

Hi.

I run this script to search particular text in sys.columns and I get a lot of "dbo.syncobj_0x3934443438443332" this kind of result.

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.

+4  A: 

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 also doesn't mean anything for us. They're used only for replication purposes.

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 View, 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 thing 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.

hgulyan
+1 for posting the answer. Go ahead and accept it.
John Saunders
It says, I need to wait a while. "You can accept your own answer in 16 hours". Thanks:)
hgulyan