0

When I am preparing to setup a new replication in an new server as an old server. I noticed that the subscriber displayed in the subscription properties is ADPASDB6006enter image description here

but what I used T-SQL find is PASDMAIN enter image description here

So my questions are:

Q1. Why are the subscriber different? If the ServerName in the sys.names is wrong how to change it?

Q2. How to link table MSsubscriber_info to other tables to get more subscriber info, like table MSpublications?

here is my code

--get the publication, article subscriber and destination_db INFO USE distribution;
GO

SELECT 
    @@SERVERNAME as PublisherServer,
    pub.name as Distributor,
    p.publication,
    p.publisher_db,
    a.article_id,
    a.article,
    sub.name as SubscriberName,
    s.subscriber_id,
    s.subscriber_db,
    s.subscription_type,
    p.publication_id,
    a.source_object,
    a.destination_object
FROM 
    dbo.MSpublications p
INNER JOIN 
    dbo.MSarticles a ON p.publication_id = a.publication_id
INNER JOIN 
    dbo.MSsubscriptions s ON a.article_id = s.article_id
left join master.sys.servers sub on s.subscriber_id=sub.server_id
left join master.sys.servers pub on p.publisher_id=pub.server_id
where s.subscriber_db<>'virtual'

select * from MSsubscriber_info
select name, server_id from sys.servers where server_id=2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.