Showing posts with label configuration. Show all posts
Showing posts with label configuration. Show all posts

Sunday, March 11, 2012

Bidirectional transactional replication and remote distributors

I want to be able to setup the following configuration using bidirectional transactional replication on SQL 2005

instance A lives on machine 1

instance B lives on machine 2

Instance A publishes to a transactional subscription on Instance B

Instance B does the reverse and publishes to a transactional subscription on Instance A

Instance A pushes to a distribution database on machine 2

Instance B pushes to a distribution database on machine 1

Problems Implementing Configuration

I can setup each instance as a distributor and create separate distribution databases using

sp_adddistributor and sp_adddistributiondb

I can then enable each publisher to use the correct distribution database using sp_adddistpublisher

However, when I try and run sp_replicationdboption to setup a database for publication, I get the error:

Msg 20028, Level 16, State 1, Procedure sp_MSpublishdb, Line 55

The Distributor has not been installed correctly. Could not enable database for publishing.

If I try and configure a publication with the wizard, it says that instance A must be enabled as a publisher before you can create a publication - and then presents the dialog to add instance A to be handled by the local distribution database - which I don't want.

It appears that I need to run sp_adddistributor on the publisher as well as the distributor for the appropriate instance, but if I do this I get the error:

Msg 14099, Level 16, State 1, Procedure sp_adddistributor, Line 109

The server 'instance A' is already defined as a Distributor.

It seems that you can't select a remote distributor if you already have a local distributor configured.

Is there a way round this limitation?

Note that configuring the environment with a single distribution database works fine

Try calling sp_adddistpublisher on machine 1 to add machine 2 as publisher and do the same on machine 2 to add machine 1 as publisher.

Regards,

Gary

|||Check out the new Peer-Peer replication in 2005 which does exactly what you want.|||

Gary - I have tried what you suggested and got the following error as per my original post

Msg 14099, Level 16, State 1, Procedure sp_adddistributor, Line 109

The server 'instance A' is already defined as a Distributor.

=====================

Dinakar - thanks for the suggestion - I have been checking out peer to peer, but I am not sure if I can live with the restrictions

=====================

I will probably go with a single distribution database located on the publisher with the lowest load. This should be satisfactory for the requirements

Thanks

aero1

Sunday, February 19, 2012

best way to retrieve one row for use in code

i have a SQL backend and some of the data in my tables is more or less configuration data and some times i only want to pull one row of data which i can do just fine with a SQL query but whats the best method to pull it.

assume i have a query like this.

Select A, B, C from Table1 where ID=xyz

whats the easiest way to get A, B and C in to string variables?

I know i can use the sqldatasource control but i just feel there is too much overhead there.

whats your suggestions?

Thanks

Justin

I suggest that you use aSqlDataReader.

HTH,
Ryan