Groups | Blog | Home
all groups > sql server replication > january 2005 >

sql server replication : Stored Procedure to Enable Replication


Shane Lim
1/31/2005 3:47:01 PM
I am trying to run the sp_replicationdboption stored procedure to
start setting up replication. My query looks like this :

exec sp_replicationdboption @dbname = N'Manual', @optname = N'merge
publish', @value = N'true'


However I get an error of:

Server: Msg 20028, Level 16, State 1, Procedure sp_MSmergepublishdb,
Line 53
The Distributor has not been installed correctly. Could not enable
database for publishing.
The replication option 'merge publish' of database 'Manual' has been
set to false.




When I run the sp_helpserver my ID is 0 and when I run @@servername I
get the correct instance.


Is there another stored procedure I am supposed to run first?

Shane Lim
Hilary Cotter
1/31/2005 11:51:17 PM
what happens when you go to tools, replication, enable replication?

--
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
[quoted text, click to view]

Shane Lim
2/1/2005 10:15:10 AM
On Mon, 31 Jan 2005 23:51:17 -0500, "Hilary Cotter"
[quoted text, click to view]


That enables that replication and I have to setp the distribution
Database. How can I do this using stored procedures? This has to be
something that the user doesn't see or even know about if possible.

Shane Lim
cdbrown_77
2/1/2005 4:27:01 PM
Depending on where your putting your distribution database you can run

EXEC master..sp_adddistributor @distributor = 'Name of Distribution Server'
GO
EXEC master..sp_adddistributiondb @database = 'Name of Distribution Database'
GO

Then you will need to set up connection criteria for the publishers

EXEC master..sp_adddistpublisher @publisher = 'Publishing Server',
@distribution_db = 'Name of Distribution Database', @working_directory = 'UNC
path to shared directory if distribution database is remove or directory if
local'

if your distribution database is remote you will need to run:

EXEC master..sp_adddistributor @distributor = 'Name of Server'
GO

Hope this helps. The first two procedures will help you define the
distributor and create the distribution database.


[quoted text, click to view]
AddThis Social Bookmark Button