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

3
votes
3answers
967 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
16 views

Launching SQL Agent Job from stored procedure not on [msdb] database, or, How Necessary is SET TRUSTWORTHY ON?

(With apologies in advance since I've been asked to pick up a project written by someone with more skills than me but who I can no longer ping for questions. If it sounds like I may be using ...
0
votes
2answers
67 views

Sql Agent Jobs executes too slow

I have posted a question like this before but is seems that I did not explain the whole story clear. So I made this one to explain it in details. Here's the stored procedure USE [xxxx] GO /****** ...
7
votes
5answers
4k views

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

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 ...
0
votes
1answer
22 views

SSIS Package not retaining parameters in SQL Server agent job

I have an SSIS package stored in the Integration Services catalogs on a SQL server instance. This package is used as a step in a SQL Server agent job. The package has 4 required parameters. Using ...
0
votes
1answer
47 views

SQL Job to be run earlier on last work day of month

Right now, I have a SQL job (within SQL Server 2008 R2) that dumps a complex select statement into a table every weeknight (excluding weekends) and it works great. Due to our company's Month End ...
0
votes
2answers
70 views

Executing sp in ssms much faster than executing in job step

My stored procedure takes 23 secs in ssms but takes 4 minutes when exec via job. Can you please help me in finding out. Below is SP code ALTER procedure [ops].[trailers_sitting_builder_mod] --WITH ...
1
vote
1answer
27 views

Proper way to store a password within a SQL Server agent job

I know this is a stupid idea, but I'm having a hard time finding a better solution right now. I need to execute several sql stored procedures on a daily basis, then execute a powershell script to ...
1
vote
1answer
14 views

Why do you have to execute a full backup after a new database for trans backup jobs to run

Playing around on my local sql server at home after an issue occurred at work. We have full backup jobs scheduled on Mondays only. I created a DB on Tuesday (when doffs and trans are scheduled). ...
0
votes
1answer
554 views

SQL Server Agent Error 1053

A few months back I installed SQL Server 2008R2. At the time of installation I used 1.Mixed Authentication 2.NT Authority\NetworkService as the SQL Agent user name, and the same user name for all ...
1
vote
1answer
433 views

Agent Xps getting disabled automatically

In one of SQL 2012 server, agent Xps is getting disabled automatically. There is no set pattern for the same and the issue started all of a sudden. Through profiler it was found that application named ...
0
votes
1answer
424 views

Blocked access to batch file

I am unable to execute batch files to copy backups from SQL Server 2008 R2 hosted on Windows 2008 R2 to a file share. Error: Access denied SQL Server Agent service has full control on the ...
0
votes
1answer
486 views

SQL Server Agent - Running SSIS Package with Proxy

I have followed the below article to create credentials/proxy to run a SSIS job from SQL Server Agent. ...
0
votes
0answers
31 views

Can I change “Category_Id” & “Current_execution_status” value in SQL Server 2012 through stored procedure?

I have created one job in SQL Server 2012 through SQL Server agent, and that job is not running due to some security privileges. When I am seeing through below SQL query to that my created job ...
1
vote
1answer
31 views

What to do when Sql Server Agent refuses to run a Job Step that references a missing database snapshot

I have a SQL Server Agent Job creating a snapshot of my main database every minute: -- delete snapshot if it exists if exists (select * from sys.databases where name = 'mydb_snapshot' ) begin ...
0
votes
2answers
63 views

Start Sql Server agent when sql server starts

Is it possible to automatically start the agent when sql server starts? When you boot the server than both windows services get started. But when you stop the main sql server service agent also ...
1
vote
1answer
65 views

SQL Server : Job not reconnecting to restarted Linked Server

The problem To keep two tables across two servers in sync, we have a trigger that adds a change to a MergeTable. Every so often, a merging job runs on SQL Server to push the changes to the Progress ...
3
votes
1answer
98 views

Get detailed output of SQL Agent job

We have an SQL Server Agent job that runs a maintenance plan to reindex all of the database on the server. Recently this has failed but the job history is not providing enough information to diagnose ...
2
votes
3answers
67 views

Bulk change Agent Jobs' definition to “Quit the job reporting failure” from “Go to the next step” On Failure

There are agent jobs with multiple steps in our servers and all their steps are defined as "go to the next step" "On Failure". So, even a job step fails, operator doesn't get notified because ...
4
votes
4answers
17k 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
1answer
129 views

How can I invoke an SSIS package from SQL Agent, via T-SQL, using a proxy

Building an ETL framework with many packages and a "controlfile" table that orchestrates running them in the right order and managing errors. In order to control the overall operation of the data load ...
0
votes
2answers
25 views

can i secure sql server agent job with password

i want to secure SQL server agent jobs with password or any other method is it possible?
2
votes
1answer
117 views

How to see entire job step output?

We have a powershell job that creates a pretty long output (it has robocopy output, among other things). In the SQL Agent Job History, we only see the first 1k or so of this output. 1) Is there ...
1
vote
0answers
1k views

How to debug problems with SQL Server multiserver (Master and Target server) administration?

I've tried to set Mater and Target Servers on various cobinations of SQL Servers 2012 R2 on Window Server 2008 R2 and Windows 7 machines but always getting one or 2 of the following errors during ...
0
votes
1answer
52 views

how to use trigger to make SQL Job's step success or fail

Step 1. Call a script to trigger application process. When the application process start, it will insert a record to a specific table. And once the process ends, that record will be deleted from ...
0
votes
1answer
102 views

Export SQL Agent jobs with steps and scripts

I recently saw some kind of export of SQL jobs configured under SQL Server Agent that I would like to achieve as well. Unfortunately I don't have any trace to author of that report to ask him\her ...
1
vote
3answers
6k views

How to move a SQL Agent Job to another Server?

I'm moving from SQL Server 2005 to SQL Server 2008R2, and I see there is one job in the SQL Server Agent Jobs that I need to move but I see it also in the SSIS---> Stored Packages\MSDB\File ...
0
votes
2answers
522 views

How to provision the SQL Server Agent service after SQL Server Edition upgrade

I have upgraded SQL Server 2008 R2 Express to SQL Server Standard Edition. After I have upgraded it, the SQL Server Agent was stopped. I have tried to start but it fails. Only when I have changed ...
-1
votes
2answers
188 views

Update code works in manual stored procedure but not when run as SQL Server Agent Job

I have a stored procedure that deletes all records from an existing table, and then inserts new records. After the insert I have several update operations that change the value of one field. If I run ...
0
votes
2answers
73 views

What is the Query to display the failed sql jobs

What is the Query to display the failed sql jobs,so that I can get all the failed job information with one query
1
vote
0answers
53 views

Failed to notify 'DBA Team' via email

I setup a test job to test out my failure notifications and now I'm getting the following stating it did not notify my operator via email. The strange thing is I ran the same exact setup script on ...
0
votes
0answers
46 views

Scheduled Job Succeeds, Does Nothing; Manual Job Succeeds, Performs Requirements

I have a job in SQL Server Agent (2012 Instance) that deletes rows from a table. When I manually run the job, it succeeds without issue and in reviewing the table, does exactly what I want it to do. ...
4
votes
2answers
465 views

Execution-Policy Error running Powershell Script in SQL Server Agent

Running a powershell script from SQL Server Agent in 2014 using my AD account via a credential. I am getting the following error. A job step received an error at line 1 in a PowerShell script. The ...
2
votes
2answers
774 views

Execute Remote Powershell script from SQL Agent

A test SQL Server job hangs when it executes a Powershell script. It does work using my login and a Powershell window, but not using the Agent account and a job. The SQL Agent user has ...
2
votes
1answer
808 views

Why do connections to my database fail, but only sometimes?

I am having some trouble diagnosing the cause of a problem I am having with Microsoft SQL Server 2008 R2. There is an application written in C#.net that connects to the database. Occasionally the ...
0
votes
1answer
175 views

Stop agent job after executing for a certain number of hours

I have a scheduled job which runs nightly. I want it to stop itself at 07:00AM in the morning whether or not it is completed. I have seen some duplicates in the site but they don't exactly address the ...
0
votes
0answers
88 views

SSIS cannot access the file

I have a SSIS package which performs a few tasks using SQL Server Agent. First it executes a script task, then accesses Excel files, executes a SQL query and moves files to another directory. The ...
1
vote
4answers
3k views

Execute permission denied on object sp_start_job

I need to allow a user to kick of a specific agent job without having any ability to start other ones. To accomplish this, I've created the following procedure (simplified): ALTER PROCEDURE ...
1
vote
0answers
24 views

Is it possible for a user that is not the job owner to edit the job or add new steps?

My development lead is ok to revoke the sysadmin privileges he currently has, if there is a way he can still edit/execute/enable-disable/execute application jobs. So far, I see that with the ...
8
votes
1answer
5k 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 ...
0
votes
1answer
181 views

How SQL Server agent calculates next run date for a job

I am developing a system for scheduling task & I am following Microsoft SQL agent approach to schedule task. I have replicated sysschedules table for capturing users scheduling occurrences and ...
1
vote
1answer
62 views

Sql Server Agent is part of the sysadmin role even tough Sql Server says it's not

I created a Windows account with no extra rights other than domain user and set it as the SQL Server Agent service account with the SQL Server Configuration Manager. The BoL/MSDN says that this user ...
5
votes
1answer
2k 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 ...
2
votes
1answer
2k views

Which user does Windows Authentication of a maintenance plan authenticate? before whom, why and for what?

I am having a maintenance plan configured with Windows Authentication being run by an SQL Server Agent job with owner sa Whom does Windows Authentication of a maintenance plan authenticate, ...
0
votes
1answer
130 views

If you schedule a TSQL Job in SQL Server 2008 R2 and additionally need to copy files with it, is it better just to use a script?

I noticed that alot of backup jobs are scheduled using SQL Server 2008 R2, but we have a system here at work that also requires the backup of a directory in addition to the database contents. I've ...
0
votes
3answers
83 views

Resume job 'A' at some step till job 'B' is completed

I have two SQL Agent jobs 'A' and 'B' Job 'A' has 10 Steps and it starts at 5:00 Am as per schedule, job 'B' has 5 Steps and it Starts by using trigger in step 3 of job 'A', job 'B' should be ...
1
vote
1answer
48 views

How can I log the way in which a job was started?

Using SQL Server Agent, I've created a Job that runs some SQL. This SQL does some work on one database, then adds a row to a logging table on a separate database. The Job is run on a couple of ...
1
vote
2answers
890 views

Disabling certain steps in a job

I have a project coming this weekend where all the jobs has to be stopped but only 1 step in a particular job has to be run. for eg: i have a a 2 step job and the second step must run and the first ...
0
votes
2answers
890 views

Can SQL Agent job notifications be sent to one operator for success and another for failure?

We have a requirement that some people are sent notification on success, and other on failure. But the UI seems to only allow a combination of 1 operator + 1 condition. So I was wondering if we ...
1
vote
2answers
2k 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 ...