What is syncobj in SQL Server

When I run this script to search for specific text in sys.columns , and I get a lot of "dbo.syncobj_0x3934443438443332" similar lines.

 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, these are replication objects. This is true? Can I just throw them out of my query just like o.name NOT LIKE '%syncobj%' or otherwise?

Thanks.

+7
sql sql-server database-replication
source share
2 answers

I have found a solution. Doesn't know if this is the best 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 now perfect. As I said, syncobj are replication objects, and they do not matter to us. They are used for replication purposes only.

http://www.developmentnow.com/g/114_2007_12_0_0_443938/syncobj-views.htm

EDIT:

Forgotten to add syncobj are stored in the database as Views, so if you need a list of views, you probably have to ignore them, as in my question.

Checking the difference between syncobj and my views, the only difference is the is_ms_shipped column. For syncobj, this is 1, for others 0. This means that syncobj views are created by the system.

PS I will wait for a while, and if no one gives another answer, I will accept mine.

+11
source share

When you create a replication that does not include all fields or other metadata changes from the source table. If you create a script file from a publication, it will show you how it is created (see below). The view provides an object for generating bcp statements during initial snapshots.

Here is an example

- Adding an 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_subs GOsubs

PS I recently had a problem when I deleted replication, it didn’t delete them, and then you need to manually delete the system views in order to reuse the replication script. Error Reporting

Msg 2714, Level 16, State 3: An object already exists with the name 'syncobj_0x3437324238353830' in the database.

This caused bcp to crash during snapshot.

+1
source share

All Articles