I am trying to set up transactional replication. I want to specify a job name for my agents because I want the names to have meaning. (Unlike the names Microsoft makes up if I leave it to default.) I am defining the job with:
exec msdb.dbo.sp_add_job
@job_name='Replication - AdventureWorks2012 Log Reader Agent',
@enabled=1,
@notify_level_eventlog=2,
@notify_level_email=1,
@notify_level_netsend=0,
@notify_level_page=0,
@delete_level=0,
@description='AdventureWorks2012 Log Reader Agent',
@category_name='REPL-LogReader',
@owner_login_name='sa';
Then I attempt to define the agent with
exec sys.sp_addlogreader_agent@job_name = 'Replication - AdventureWorks2012 Log Reader Agent',
@publisher_security_mode = 1;
And I get...
The specified Logreader Job ('Replication - AdventureWorks2012 Log Reader Agent') does not exist.
If I comment out the @job_name parameter - an agent does get defined.
What am I doing wring here?
John