Tejas,
your script seems ok. I have added a similar one I just set up which runs ok
albeit using anonymous subscribers, but that shouldn't make any difference.
I don't see any big differences in our scripts but if you do please let me
know. Anyway, please can you try running the distribution agent and have it
log to a text file so we can be sure this error is generated by the
distribution agent and not another subscription
(
http://support.microsoft.com/?id=312292). Also, preferably run the agent
from the commandline to avoid any other issues.
Cheers,
Paul Ibison SQL Server MVP,
www.replicationanswers.com (recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
-- Adding the distribution database
exec sp_adddistributiondb @database = N'distribution', @data_folder =
N'C:\Program Files\Microsoft SQL Server\MSSQL\Data', @data_file =
N'distribution.MDF', @data_file_size = 3, @log_folder = N'C:\Program
Files\Microsoft SQL Server\MSSQL\Data', @log_file = N'distribution.LDF',
@log_file_size = 0, @min_distretention = 0, @max_distretention = 72,
@history_retention = 48, @security_mode = 1
GO
-- Adding the distribution publisher
exec sp_adddistpublisher @publisher = N'LON36', @distribution_db =
N'distribution', @security_mode = 1, @working_directory =
N'\\LON36\C$\Program Files\Microsoft SQL Server\MSSQL\ReplData', @trusted =
N'false', @thirdparty_flag = 0
GO
-- Adding the transactional publication
exec sp_addpublication @publication = N'NorthwindRegions', @restricted =
N'false', @sync_method = N'native', @repl_freq = N'continuous', @description
= N'Transactional publication of Northwind database from Publisher LON36.',
@status = N'active', @allow_push = N'true', @allow_pull = N'true',
@allow_anonymous = N'true', @enabled_for_internet = N'false',
@independent_agent = N'true', @immediate_sync = N'true', @allow_sync_tran =
N'false', @autogen_sync_procs = N'false', @retention = 336,
@allow_queued_tran = N'false', @snapshot_in_defaultfolder = N'true',
@compress_snapshot = N'false', @ftp_port = 21, @ftp_login = N'anonymous',
@allow_dts = N'false', @allow_subscription_copy = N'false',
@add_to_active_directory = N'false', @logreader_job_name =
N'LON36-Northwind-7'
exec sp_addpublication_snapshot @publication =
N'NorthwindRegions',@frequency_type = 4, @frequency_interval = 1,
@frequency_relative_interval = 1, @frequency_recurrence_factor = 0,
@frequency_subday = 8, @frequency_subday_interval = 1, @active_start_date =
0, @active_end_date = 0, @active_start_time_of_day = 0,
@active_end_time_of_day = 235959, @snapshot_job_name =
N'LON36-Northwind-NorthwindRegions-12'
GO
-- Adding the transactional articles
exec sp_addarticle @publication = N'NorthwindRegions', @article = N'Region',
@source_owner = N'dbo', @source_object = N'Region', @destination_table =
N'Region', @type = N'logbased', @creation_script = null, @description =
null, @pre_creation_cmd = N'drop', @schema_option = 0x00000000000000F3,
@status = 16, @vertical_partition = N'false', @ins_cmd = N'CALL
sp_MSins_Region', @del_cmd = N'CALL sp_MSdel_Region', @upd_cmd = N'MCALL
sp_MSupd_Region', @filter = null, @sync_object = null, @auto_identity_range
= N'false'
GO
-- Enabling the replication database
use master
GO
exec sp_replicationdboption @dbname = N'Northwind', @optname = N'merge
publish', @value = N'true'
GO
use [Sub2]
GO
exec sp_addpullsubscription @publisher = N'lon36', @publisher_db =
N'northwind', @publication = N'northwindregions', @independent_agent =
N'true', @subscription_type = N'anonymous', @update_mode = N'read only',
@immediate_sync = 1
exec sp_addpullsubscription_agent @publisher = N'lon36', @publisher_db =
N'northwind', @publication = N'northwindregions', @distributor = N'lon36',
@subscriber_security_mode = 1, @distributor_security_mode = 1,
@frequency_type = 64, @frequency_interval = 1, @frequency_relative_interval
= 1, @frequency_recurrence_factor = 0, @frequency_subday = 4,
@frequency_subday_interval = 5, @active_start_date = 0, @active_end_date =
0, @active_start_time_of_day = 0, @active_end_time_of_day = 235959,
@enabled_for_syncmgr = N'true', @alt_snapshot_folder =
N'C:\LON36_Northwind_NorthwindRegions\20051114172547', @use_ftp = N'false',
@publication_type = 0, @dts_package_location = N'subscriber', @offloadagent
= N'false'
GO