您的位置:首页 > 数据库

查看当前数据库中的表哪些包含同步链

2013-01-30 11:26 363 查看
use distribution
go
SELECT
source_Server=@@SERVERNAME ,source_db =A.publisher_db,
source_Object_schema =A.Source_owner,source_Object_name=A.source_object,
destination_Server=srv.name,destination_db=S.Subscriber_db,
destination_object_schema=A.Source_owner,destination_object_name=A.destination_object
,tb.publication,tb.name as jobname
FROM dbo.MSpublications AS P WITH (NOLOCK)
inner join dbo.MSarticles AS A WITH (NOLOCK)
on p.Publication_id = A.Publication_id
INNER JOIN dbo.MSsubscriptions AS S WITH (NOLOCK)
ON S.Publication_id = P.Publication_id	and S.article_id = a.article_id
INNER JOIN sys.servers as srv WITH (NOLOCK)
ON S.subscriber_id = srv.Server_id
inner join dbo.MSdistribution_agents as tb with(nolock)
on  S.agent_id = tb.id
where A.source_object in ('tb_Reptest')
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: