Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Running a job from within a Stored procedure..

Author  Topic 

RobMarsh
Starting Member

28 Posts

Posted - 2002-09-04 : 15:49:54
Hi,
I'm trying to run a Job from within a stored procedure, this is the only line in the procedure:

EXEC msdb.dbo.sp_start_job @job_name = 'PayPlus Backup Job'

This is fine when the stored procedure is run from the Query Analyser, but when run from
an ASP page I get the following error:

Error number :-2147217900
Error Message :[Microsoft][ODBC SQL Server Driver][SQL Server]The specified @job_name ('PayPlus Backup Job') does not exist

I'm sure this is some sort of out of context problem, but I'm not sure how to solve it.

Any suggestions?

nr
SQLTeam MVY

12543 Posts

Posted - 2002-09-04 : 16:59:36
It's probably a user problem.
You can only access jobs owned by you.
Maybe the job is created by sa and the app conects as a user or vice versa.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

RobMarsh
Starting Member

28 Posts

Posted - 2002-09-05 : 13:10:00
thanks, thats sorted it nicely.

Go to Top of Page
   

- Advertisement -