1

如何获取未在出版物中添加的所有视图存储过程replication的列表?

你能帮我制作存储的 Proc 吗?我是 Replication 的新手......谢谢

4

2 回答 2

0

试试这个——

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
于 2013-04-11T05:58:18.437 回答
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)
于 2013-04-11T15:42:39.310 回答