The sql-server-agent tag has no wiki summary.
10
votes
2answers
1k 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 ...
6
votes
3answers
205 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 ...
6
votes
1answer
146 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
5answers
184 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 ...
5
votes
2answers
301 views
How does SQL Server AlwaysOn work with help with scheduled jobs and SSIS packages?
I have 2 sql servers set up with a database within 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 ...
5
votes
2answers
495 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; ...
4
votes
2answers
725 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
1answer
1k 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 ...
4
votes
2answers
372 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
1answer
207 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 ...
3
votes
2answers
87 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
2answers
1k 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
2answers
80 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 ...
3
votes
4answers
992 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 ...
3
votes
2answers
468 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 ...
3
votes
1answer
197 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 ...
2
votes
2answers
214 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 ...
2
votes
2answers
439 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 ...
2
votes
1answer
88 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 ...
2
votes
2answers
827 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.
...
2
votes
2answers
131 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
4k 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
2k 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
253 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
153 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
1answer
393 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 ...
2
votes
0answers
100 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 ...
1
vote
2answers
2k 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
355 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
199 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
64 views
SQL Server Agent
hi
i need to run a procedure every first day of month. And the procedure should automatically run at every month.So with out using timer i have to use it. So i Think Better to go for SqlServer agent ...
1
vote
4answers
426 views
Could not find the Server Agent in SSMS
I am following the guide - http://sqlserverpedia.com/blog/sql-server-bloggers/how-to-create-a-server-side-trace-with-sql-profiler/ which is working until I reach Step 8
8. Now to schedule your newly ...
1
vote
1answer
113 views
How can I change SQL Agent Log file to use unicode format?
I've created a database with tables that heavily leverages nvarchar for most of the columns. One of the challenges I'm running into is that when I go to view the SQL Server Agent Log files, I get the ...
1
vote
1answer
94 views
SQL Server - Ignoring object dependencies to copy a DB (despite some column referenced in a sproc no longer existing)
First of all apologies for the novel but there's a lot to explain...
We have over 100 databases for our product, 1 per server, each of which has variations on other ones (ideally they should all be ...
1
vote
1answer
137 views
Connect to SQL Server 2012 Database from 2008 Agent Job containing 2008 SSIS Package
I'm planning the rollout of SQL Server 2012. My client has a number of SQL Server Integration Services (SSIS) packages currently deployed to SSIS 2008 and consumed by SQL Server Agent Jobs defined on ...
1
vote
1answer
66 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
...
1
vote
0answers
79 views
Requesting advice on creating a table controlled SQL job scheduler
I have been tasked with cleaning up a series of SQL jobs that send email updates about various data and system conditions in my company. Currently, there are a ton of jobs, each with its own SQL code ...
1
vote
0answers
390 views
Why is the next scheduled run date for my SQL Server job NULL?
I've been dealing with the Microsoft SQL Server Agent with regards to scheduling jobs.
I'm trying to find out what the next scheduled run date for a bunch of jobs that were created where the job ids ...
0
votes
1answer
261 views
How to give SQL Server Job Owner permission to Proxy a Credential
I've created a Credential Cred1 (DOMAIN\USER1 with the secret = domain password)
I've created a SQL Agent job with owner to NT AUTHORITY\SYSTEM
The job needs to proxy as credential Cred1
So when I ...
0
votes
1answer
24 views
Run job in agent based on table data
Is there a way to start a SQL Server agent job if a table is not empty?
Basically, first I want to check a table, and if the table is not empty then start the job. If it is empty, then check every 1 ...
0
votes
1answer
147 views
Differences between CMS and MSX/TSX?
What is the differences between Central Management Servers and Master Server (MSX) / Targer Server (TSX) concepts in SQL Server? I know that MSX/TSX is related to SQL Agent and the basic idea is to ...
0
votes
1answer
139 views
Copy files using script to a network share
Is there a simple script I can use to copy files in a particular folder to a network share? This is for use with SQL Server Agent so I can run it as a step after backups.
Thanks
0
votes
1answer
286 views
Make SQL Server Agent retry failed script with Try/Catch
I have a script that has a try catch in it so that if it fails I can roll back the transaction. It runs on a job scheduled through SQL Server Agent. But when it fails SQL Server Agent does not see ...
0
votes
0answers
58 views
Dates, times and SQL jobs [closed]
This is probably a silly question but if I want a job to run Sunday at midnight would I choose Sunday 12:00AM or Monday 12:00AM?


