Now each time I attempt to run a job it errors with;
Error 22022: SQLServerAgent is not currently running so it
cannot be notified of this action.
However, SQL Server Agent is shown to be running in the
task bar.
I am running Windows .Net Server 2003 RC2
Ge...@SQLDev.Net
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copyright © SQLDev.Net 1991-2003 All rights reserved.
"Dwight Brown" <dmbPr...@comcast.net> wrote in message
news:2b3301c2f14c$d30fed00$a301...@phx.gbl...
The Job Never starts because SQLServer thinks SQLAgent is
not running. - Very Frustrating.
---- I would be interested to know how SQL server
associates Agent with the windows service. Control panel
services shows the SQLSERVERAGENT, everything looks fine.
no errors. Can stop and start as needed manually.
>.
>
Send the LOG file with this setting turned on
Also the send the results of:
exec msdb.dbo.sp_get_sqlagent_properties
Ge...@SQLDev.Net
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copyright © SQLDev.Net 1991-2003 All rights reserved.
"Dwight Brown" <dmbpr...@comcast.net> wrote in message
news:2f4001c2f162$6d5ebed0$a001...@phx.gbl...
///results of sp_getsqlagent_prop../////
sorry for the formatting....
Message Tab Results
Access is denied.
Access is denied.
GRID Results below
auto start
1
msx server name
null
sqlagent_type
1
startup account
.\SQLAgent
sqlserver_restart
1
jobhistory_max_rows
1000
jobHistory_max_rows_per_job
100
errorlog_file
C:\Program Files\Microsoft SQL
Server\MSSQL\LOG\SQLAGENT.OUT
errorlogging_level
7
error_recipient
null
monitor_autstart
o
local_host_server
NULL
job_shutdown_timeout
15
emdexec_account
null
regular_connections
0
host_login_name
NULL
host_login_password
NULL
login_timeout
30
idle_cpu_precent
10
idle_cpu_duratioin
600
oem_errorlog
0
sysadmin_only
1
email_profile
NULL
email_save_in_sent_folder
0
cpu_poller_enabled
0
>.
>
Anyhow SQL Agent does start normally, so sp_sqlagent_notify is the part that
seems to be failing.
CREATE PROCEDURE sp_sqlagent_notify
@op_type NCHAR(1), -- One of: J (Job action [refresh or
start/stop]),
-- S (Schedule action
[refresh only])
-- A (Alert action [refresh
only]),
-- G (Re-cache all registry
settings),
-- D (Dump job [or job
schedule] cache to errorlog)
-- P (Force an immediate
poll of the MSX)
@job_id UNIQUEIDENTIFIER = NULL, -- JobID (for OpTypes 'J', 'S' and
'D')
@schedule_id INT = NULL, -- ScheduleID (for OpType 'S')
@alert_id INT = NULL, -- AlertID (for OpType 'A')
@action_type NCHAR(1) = NULL, -- For 'J' one of: R (Run - no
service check),
-- S (Start - with
service check),
-- I (Insert),
-- U (Update),
-- D (Delete),
-- C (Stop [Cancel])
-- For 'S' or 'A' one of: I
(Insert),
-- U
(Update),
-- D (Delete)
@error_flag INT = 1 -- Set to 0 to suppress the error
from xp_sqlagent_notify if SQLServer agent is not running
You can try starting your job this way:
declare @job_id uniqueidentifier
select @job_id = job_id from msdb.dbo.sysjobs where name = 'YourMyJob'
select @job_id
exec msdb.dbo.sp_sqlagent_notify
@op_type = 'J',
@job_id = @job_id,
@schedule_id = NULL,
@alert_id = NULL,
@action_type = 'S',
@error_flag = 1 -- Set to 0 to suppress the error from
xp_sqlagent_notify if SQLServer agent is not running
Ge...@SQLDev.Net
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copyright © SQLDev.Net 1991-2003 All rights reserved.
"Dwight Brown" <dmbPr...@comcast.net> wrote in message
news:2f7f01c2f16e$97d0b810$a001...@phx.gbl...
Also the Access Denied Appears as the first two lines in
the text output, I remembered that from yesterday..
Thanks Dwight
>..\SQLAgent
>.
>
Server: Msg 170, Level 15, State 1, Procedure
sp_sqlagent_notify, Line 3
Line 3: Incorrect syntax near 'start'.
Server: Msg 170, Level 15, State 1, Procedure
sp_sqlagent_notify, Line 47
Line 47: Incorrect syntax near 'xp_sqlagent_notify'.
dwight
>.
>
However am having trouble. Ran the part you suggested as
try to strart your job this way. Results below..
(1 row(s) affected)
Server: Msg 14262, Level 16, State 1, Procedure
sp_sqlagent_notify, Line 54
The specified @job_id ('(null)') does not exist.
I am sure It is something I failed to add to the job, like
a job id. Not sure where..
dwight
>.
>
(1 row(s) affected)
Server: Msg 22022, Level 16, State 1, Line 0
SQLServerAgent is not currently running so it cannot be
notified of this action.
dwight
>.
>