?
Solved

could not find stored procedure 'sp_add_jobserver'

Posted on 2007-11-20
3
Medium Priority
?
1,435 Views
Last Modified: 2012-08-13
i need to run a t-sql statement in a maintenance plan. the t-sql is written and functions correctly from query analyzer but i get an error message that i need to specify sp_add_jobserver for it to run in the maintenance plan. when i add this line into query analyzer with teh correct parameters i get the error message Msg 2812, Level 16, State 62, Line 2
Could not find stored procedure 'sp_add_jobserver'.

here is my query:


use master 
exec sp_add_jobserver @job_name = 'DBBackup.DBBackup' , @server_name = 'csvmsql2005'
 
DECLARE @DBName sysname
DECLARE @PrevDBName sysname
DECLARE @sql nvarchar(255)
DECLARE @StartName sysname
DECLARE @EndName sysname
 
SET @StartName = ''
SET @EndName = 'zzzzzzzzzzzzzzzzzzz'
 
SELECT TOP 1 @DBName = name FROM master.dbo.sysdatabases 
WHERE sid <> 0x01 AND name BETWEEN @StartName AND @EndName
ORDER BY name
WHILE @DBName IS NOT NULL
BEGIN
  PRINT 'Processing database ' + @DBName
  IF databasepropertyex(@DBName,'recovery') = 'FULL'
  BEGIN
    Print '  Recovery Mode is ' + convert(varchar,databasepropertyex(@DBName,'recovery')) + '. Setting it to SIMPLE.'
    SET @sql = N'ALTER DATABASE ' + CONVERT(nvarchar,@DBName) + N' SET RECOVERY SIMPLE'
    EXEC sp_executesql @sql
  END
  ELSE
    Print '  Recovery Mode is ' + convert(varchar,databasepropertyex(@DBName,'recovery')) + '.'
  
  SET @PrevDBName = @DBName
  SET @DBName = NULL
  SELECT TOP 1 @DBName = name FROM master.dbo.sysdatabases 
WHERE sid <> 0x01 AND name BETWEEN @StartName AND @EndName
AND name > @PrevDBName 
ORDER BY name
END

Open in new window

0
Comment
Question by:newimagent
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 2000 total points
ID: 20320574
sp_Add_jobServer  does not exist in master db, it is in msdb


use master
exec msdb.dbo.sp_add_jobserver @job_name = 'DBBackup.DBBackup' , @server_name = 'csvmsql2005'
0
 
LVL 3

Expert Comment

by:john_steed
ID: 20320590
Hi,

I think sp_add_jobserver is in the msdb database, try to specify that (since you're having "use master" on top of the script)

exec msdb.dbo.sp_add_jobserver....

hope this helps
0
 
LVL 1

Author Comment

by:newimagent
ID: 20321012
i tried it without the use master as well to no avail, but using exec msdb.do.sp_add_jobserver did the trick!

Thank you!
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question