SQL Server Agent is a Windows service installed with the SQL Server Standard Edition and above. It provides an automated way of executing or performing administrative task against a SQL Server instance. SQL Server Agent is a tool that every DBA should become familiar with and utilize to its full ...

learn more… | top users | synonyms

10
votes
2answers
3k views

Good way to call multiple SQL Server Agent jobs sequentially from one main job?

I've got several SQL Server Agent jobs that should run sequentially. To keep a nice overview of the jobs that should execute I have created a main job that calls the other jobs with a call to EXEC ...
9
votes
3answers
2k views

SQL Server Agent Jobs and Availability Groups

I'm looking for best practice in dealing with scheduled SQL Server Agent jobs in SQL Server 2012 availability groups. Maybe I missed something, however at the current state I feel that SQL Server ...
8
votes
3answers
762 views

I'm using the SQL Server Agent to schedule even non-database tasks - is this a bad idea?

Since I'm a DBA (and in many cases, the de-facto sysadmin), SQL Server is installed on pretty much every server I have to work with regularly. I realized recently that I've been using the SQL Agent as ...
7
votes
2answers
2k views

How do Availability Groups work with cheduled jobs and SSIS packages?

I have 2 SQL Servers set up with a database in an AlwaysOn Availability Group. I also have jobs set up which run against the database. During a failover how do I ensure the jobs will continue to run ...
6
votes
4answers
488 views

Run Server Agent Job on Schedule only if CPU is idle

I have a job set up in SQL Server Agent to run an update query. I want this job to execute every night between midnight and 5am and I want it to repeat every 5 minutes during that time frame. But I ...
6
votes
4answers
3k views

What's a good tool for visualizing SQL Agent jobs?

I find the built-in MS SQL Studio tools for managing Agent jobs to be a little frustrating. What tools out there have you found helpful? Offhand, there are three things I'd like to see in such a ...
6
votes
1answer
266 views

What would be a good name for a job schedule?

I have encountered many different names for job schedules in SQL Server, ranging from the job name where it is used to a short recap of the schedule itself. I would like to give a clear, descriptive ...
5
votes
1answer
3k views

How and when does SQL Agent update next_run_date/next_run_time values?

I've been working on code in T-SQL to add new schedules to a SQL Agent job using the sp_add_jobschedule proc in the msdb database. When I add a new schedule (typically a run-once at a specific ...
5
votes
1answer
688 views

Error running Powershell Script in SQL Server Agent

I have a SQL job that runs via SQL Server Agent (Running SQL Server 2012 Enterprise). The last step of the job is to run an application located on a network share. Unfortunately I don't know the name ...
5
votes
2answers
2k views

SQL Server Agent not observing “execute as” permissions

I have a curious permissions problem. Something recently happened that caused existing SQL Server Agent Jobs that were configured to run as a particular User to stop working. They previously worked; ...
5
votes
2answers
266 views

SQL Server 2000 - 'Performance: Deadlock'

We had to restart our SQL Server today, we had made no changes to it. When it came back up we immediately started getting this error from the server DATE/TIME: 2/27/2014 3:09:31 PM ...
4
votes
4answers
6k views

Could not find the Server Agent in SSMS

I am following the guide - http://www.sqlchicken.com/2009/07/how-to-create-a-server-side-trace-with-sql-profiler/ which is working until I reach Step 8 8. Now to schedule your newly created script. ...
4
votes
2answers
987 views

SQL Server agent Error

I am in a new shop and the below error started to show up on 2/22 repeatedly until 3/7. Event Type: Error Event Source: SQLSERVERAGENT Event Category: Alert Engine Event ID: 318 Description: ...
4
votes
2answers
1k views

How do I rescue SQL Agent jobs from a set of detached master, model, mdb files?

I had a MSSQL (MSSQL 2008 R2) cluster that failed in a way that I couldn't bring it back up (long story, servers ended up in BSOD loops, I'm blaming Broadcom and myself). I've SQL backups, and even ...
4
votes
5answers
955 views

Run Multiple Remote Jobs

I need to manually run a job on more than 150 sql server instances (sql server 2000, remote) from a sql server 2005 instance (the local server). The job is the same on all these instances. The job ...
4
votes
2answers
324 views

Update strings for all cmdexec Jobs

Does anyone know if it's possible, (and furthermore advisable) to update all cmdexec strings in jobs on a server? We'd like to change our logging location, and in principle I'd think this could be ...
4
votes
1answer
356 views

SQL Server Agent fails to start in Failover cluter

The SQL server agent in a cluster (as a cluster resource) fails to start. I'm looking for error logs to give me a clue, but so far, all it says is: "failed to start". What could be the possible ...
4
votes
2answers
1k views

Sql Server Agent notification email with custom message

I have set email notification on the completition of a scheduled job. Is it possible to customize the email content?
4
votes
2answers
462 views

SQL server agent SSIS error

I get the following error when I execute my package as a SQL server agent job. It is an SSIS 2008 package running on a SQL Server 2008 instance. My package security is DontSaveSensitive. I don't ...
4
votes
1answer
1k views

Agent job will not run

I created a JOB to run a simple package that runs a query and saves the results to an Excel file. If I try to run the job In SQL Management Studio I get an error saying: SQLServerAgent is not ...
4
votes
2answers
905 views

Powershell script executing within SQL Server Agent

I am trying to use Powershell within a SQL Server Agent job to download a zip file. The script uses PuTTY (PSCP.exe) to download a zip file from a SFTP site. The issue I am having is that when the ...
4
votes
2answers
8k views

How to succesfully run a batch file in an SQL Agent job?

I have a SQL Agent Job which generates a specific report in PDF-file and then copies the PDF to a network directory and then deletes the PDF file in the source directory. The SQL Jobs consists of 2 ...
3
votes
2answers
1k views

SQL Server Agent - Run Query at the end of each month with date variable

I am running SQL Server 2008 R2, and I need to create a new job that will basically run a query at the start of each month (at the 1st of each month at 01:00 AM). Here is the query: INSERT INTO ...
3
votes
2answers
635 views

Execute a T-SQL job with a different connection string

Is it possible to execute a stored procedure from a SQL agent job while specifying a custom Application Name, similar to specifying the Application Name in a connection string? The reason I want to ...
3
votes
1answer
519 views

How to specify a task in a SQL Server maintenance plan conditionally?

I have a weekly and nightly SQL Server Agent jobs executing a weekly and nightly maintenance plans, resp. These weekly (on Sunday) and nightly (on other 6 nights of the week) maintenance plans ...
3
votes
2answers
2k views

Get failed SQL Server agent job?

How to get a list of failed job run last night? I only find the following powershell script. What's the SQL equivalence? dir $psPath\Jobs | % { $_.EnumHistory() } | ? { $_.RunStatus -ne 1 }
3
votes
1answer
320 views

Renaming SQL Server Agent operator

I want to rename SQL Server Agent operator, that is change it's name. Is this a "valid" thing to do? I noticed that trying to change name in SSMS via Operator/Properties dialog doesn't actually do ...
3
votes
3answers
2k views

Why might Sql Server Agent's Next Run Time value not be what I expect? And is this definitely the next time my job will run?

At times, I'm seeing some inconsistencies with sql server agent's value in the sysjobschedules.next_run_date and time fields. I have a web interface that interacts with the sql scheduling system. ...
3
votes
2answers
216 views

SQL agent job, why is the job history showing that a step is still running even though the job has completed

I have a sql agent job that runs Powershell as its first step (there are 3 steps in total). I have set this step to have 2 retries, with a 3 minute retry interval. When I look into the job history, ...
3
votes
0answers
194 views

SQL Server Event Alerts Lack Enough Details

I setup SQL Server Alerts to send me emails whenever certain events (by severity) occur. Below is an example of en email I received for a "014 - Insufficient Permission" severity event of Type "SQL ...
2
votes
2answers
667 views

Reset / force SQL Agent Next run date

I need to test SQL Agent over a period of time, so need to change the system clock into the future quite often (and back)... don't worry it's only my local machine not a server :-) The trouble is ...
2
votes
1answer
830 views

SQL Server 2012 SQL Agent Job with PowerShell step fails on Out-File cmdlet with “ReportWrongProviderType” error

We've recently upgraded to SQL Server 2012 (from SQL Server 2008 R2) on Windows Server 2012 (from Windows Server 2008 R2), and a SQL Server Job Agent job that was previously running without error is ...
2
votes
2answers
8k views

First time running a replication on SQL Server 2008. “The process could not connect to subscriber 'SERVER2'”

I've set up Replication between two remote servers, Using Peer to Peer & Transactional updates. The subscription is all set, but the actual replication doesn't take place. When viewing the ...
2
votes
1answer
222 views

Error checking with sp_send_dbmail

This question is kind of multifaceted. First, what I'm trying to actually accomplish: I am in an environment where there is not really heavy data validation on inputs. So there is lots of opportunity ...
2
votes
1answer
67 views

Turn Off Alerts

We have a SQL Server 2008 R2 database instance running on a VM. Nightly, between 10p and 12a, we are getting the following error message: DATE/TIME: 2/3/2014 10:16:37 PM DESCRIPTION: Database ...
2
votes
1answer
1k views

SQL Agent embedded PowerShell script in CmdExec step fails with import-module sqlps

SQL Server 2008R2 PowerShell 2.1 I am trying to create a SQL Agent job that dynamically backs up all non-corrupted SSAS databases on an instance without the use of SSIS. In my SQL Agent job, when I ...
2
votes
1answer
1k views

SQL server agent job built on SSIS package not working

I transferred a job from the old SQL Server 2005 to an upgraded SQL Server 2008 R2 instance, and I scripted out everything, changed the data source and other details... "This job should copy some ...
2
votes
1answer
458 views

Need Help Executing a Remote Task from SQL Server Agent

There is a scheduled task running on a batch server via the Windows Task Scheduler that sometimes overlaps with other scheduled jobs in the SQL Server Agent causing CPU issues. We can solve this if ...
2
votes
1answer
9k views

Access denied when trying to run an agent job

Can someone please point me in the right direction. I keep getting the below error message when I try to run a job that executes a package I created and saved on the SQL Server. 12/03/2012 ...
2
votes
1answer
584 views

SQL Server Maintenance Plan multiple database backups in a single folder

I am using SQL Server 2008 R2. I am trying to create a maintenance plan which backs up multiple databases into one single folder for a day. For ex. I need to backup db1, db2, db3 and dump all these 3 ...
2
votes
1answer
357 views

SQL Agent job does not show up in the jobs folder in SSMS although they are in sysjobs table

I tried to copy some SQL Agent Jobs from server1 to server2 by selecting rows from server1.msdb.dbo.sysjobs and inserting to server2.msdb.dbo.sysjobs. I did the same with sysjobsteps. This seemed to ...
2
votes
0answers
181 views

How do I give file system access to SQL Server's SQLSERVERAGENT virtual account?

I'm trying to grant the NT Service\SQLSERVERAGENT Windows account file system access, based on the marked answer in this question. I believe it's a virtual service account, and it does not show up in ...
2
votes
0answers
78 views

SSIS Bulk Insert Task Operating system error code 1311

I have been running SSIS 2008 R2 Packages for a long time and when ever my Packages trough SQL Server Job accesses FTP Server which is on the same domain it uses correct credentials ,e.g. ...
2
votes
0answers
109 views

send custom email when SQL Server job fails

I have setup a profile and account for sending mail using DatabaseMail. I have a SQL JOB. If the job fails, I receive an Email Till this point, everything works fine. This is what the email looks ...
2
votes
1answer
637 views

The job failed. The owner (pc\user) of job FULL DB BACKUP does not have server access

SQL Server 2008R2 is failing to execute log backup hourly. Date 5/2/2013 10:22:19 PM Log Job History (LOG BACKUP) Step ID 0 Server pc Job Name LOG BACKUP Step ...
2
votes
0answers
365 views

some SQL Server MSX targets show as Normal, Blocked

I've centralized my farm's jobs in MSX, covering about 70 instances of SQL Server. Seemingly randomly, at least once a week, several instances will stop accepting instructions. Within the MSX window ...
1
vote
2answers
4k views

Why Isn't the SQL Server Agent Service Set to Automatic Startup by Default?

After a default install of SQL Server 2008 R2, the SQL Server Agent process seems to be set to manual startup. What is the reason for this? Is setting to automatic a bad idea or pointless for some ...
1
vote
2answers
858 views

Trouble with Alerts and Notifications on SQL Server 2000

I'm trying to set up alerts and notifications in SQL Server 2000, but they are not working. I'm testing them for Agent scheduled jobs, and I get a note saying: NOTE: Failed to notify ...
1
vote
2answers
419 views

Specify a frequency range for a SQL agent schedule

I want to create a SQL agent schedule that occurs during a date range. I can't use "recurs every n weeks" because the process that it will fire off will change with each month. I need to set the ...
1
vote
1answer
945 views

Run job once a minute, every day, except during a certain time

I have a Sql server 2012 agent job which currently runs every minute, every day, etc. I'd like to modify it so that it will run every minute, every day except on Saturdays between 7:00 pm and 11:30 ...