如何获取未在出版物中添加的所有表、视图、存储过程replication
的列表?
你能帮我制作存储的 Proc 吗?我是 Replication 的新手......谢谢
试试这个——
SELECT
o.[object_id]
, [object_name] = s.name + '.' + o.name
, o.type_desc
FROM sys.sysobjects so WITH (NOLOCK)
JOIN sys.objects o WITH (NOLOCK) ON so.id = o.[object_id]
JOIN sys.schemas s WITH (NOLOCK) ON o.[schema_id] = s.[schema_id]
WHERE so.xtype IN ('P', 'V', 'U', 'TF', 'FN', 'IF')
AND so.replinfo = 1
AND o.is_published = 0
对于快照和事务:
SELECT
name
FROM sysobjects WITH (NOLOCK)
WHERE ((xtype = 'U') OR (xtype = 'V') OR (xtype = 'P')) AND
category <> 2 AND
name NOT IN (SELECT DISTINCT object_name(OBJID) FROM sysarticles)
对于合并:
SELECT
name
FROM sysobjects WITH (NOLOCK)
WHERE ((xtype = 'U') OR (xtype = 'V') OR (xtype = 'P')) AND
category <> 2 AND
name NOT IN (SELECT DISTINCT object_name(OBJID) FROM sysmergearticles)