Questions tagged [sql-server-agent]

SQL Server Agent is a Microsoft Windows service that executes scheduled administrative tasks, which are called jobs. SQL Server Agent uses SQL Server to store job information. Jobs contain one or more job steps. Each step contains its own task, for example, backing up a database. SQL Server Agent can run a job on a schedule, in response to a specific event, or on demand.

From Microsoft.com:

SQL Server Agent is a Microsoft Windows service that executes scheduled administrative tasks, which are called jobs. SQL Server Agent uses SQL Server to store job information. Jobs contain one or more job steps. Each step contains its own task, for example, backing up a database. SQL Server Agent can run a job on a schedule, in response to a specific event, or on demand.

483 questions
3
votes
1 answer

SQL Server 2K - Agent Jobs - Errors and Messages

I have a job that runs every night. I do my own logging in my stored procedure so that I can tell what was going on if something fails. Last night the job failed and I know where. When I ran the job manually it succeeded. So I went to the job…
William T Wild
  • 1,025
  • 1
  • 14
  • 23
3
votes
1 answer

SSIS add Custom Header to Excel file

We are dumping data into an excel file using SSIS. Need to add a Custom Header to the Excel file. The code below worked for many years. (on Different Windows (Win7,Win10) and different office versions (Office2007 and Office2013). string…
3
votes
2 answers

Everytime I start SQL Server Agent job I get an error log

Every time I start an Sql Server job, I get the following error. I am using SQL Server 2016. Does not anybody know how to fix it? The application-specific permission settings do not grant Local Activation permission for the COM Server application…
jmf
  • 356
  • 5
  • 25
3
votes
4 answers

SQL Agent Command Line Not Saved

I have a SSIS package I am trying to schedule. I create a new job under SQL Server Agent. On the Command line tab of the jobstep, I choose "Edit the command-line manually". The changes are retained as I switch from tab to tab within the job step but…
Greg
  • 45,306
  • 89
  • 231
  • 297
3
votes
0 answers

Error authenticating proxy while running agent job

I am trying to schedule a SSIS2014 package via SQL Server Agent job. Both SSIS and SSMS are running on my local machine in the same domain. I am running SSMS with the same user Domain\Admin which is the creator of the SSIS package. SSMS 32-Bit and…
17nxo
  • 87
  • 1
  • 3
  • 10
3
votes
4 answers

How SQL calculates NEXT_RUN_DATE for a job schedule?

I have to make a manual calculation of the next run date for a job, can you help me?
Francisco
  • 31
  • 1
  • 1
  • 2
3
votes
1 answer

Access to the remote server is denied because the current security context is not trusted, SQL server agent

I execute the following statements on the management studio perfectly, with out any problem. Execute sp_addlinkedserver 'remoteservername' execute sp_addlinkedsrvlogin @rmtsrvname = N'remoteservername', @locallogin = N'sa', @useself = N'False',…
user2569524
  • 1,651
  • 7
  • 32
  • 57
3
votes
1 answer

How to get the last run job details in SQL

How to get the last run job details in SQL Server Agent using SQL including the step details only for the last run job (not the job outcome) as i want to display this in an application Please help been stuck on this for ages This is the code I have…
neeko
  • 1,930
  • 8
  • 44
  • 67
3
votes
2 answers

SQL Server Agent Error on running an SSIS package

When trying to execute an SSIS package I get the following error: Date 14/08/2013 15:02:42 Log Job History (test) Step ID 1 Server YGAL1-MOBL1 Job Name test Step Name ssis Duration 00:00:00 Sql Severity …
Yoav
  • 999
  • 3
  • 11
  • 30
3
votes
1 answer

Notify operator task vs. notify if job fails

In a maintenance plan, I can create a Notify Operator task to run on the success or failure of any task in my maintenance plan. There is also the option to notify if an SQL Server Agent job fails, so I can enable this on the job connected to the…
johnmcp
  • 891
  • 1
  • 10
  • 17
3
votes
2 answers

SQL Server add job agent T-SQL script issue

I am using SQL Server 2008 Enterprise. I have created a very simple test SQL Server Agent job which just print out a string. And then I add a schedule to let the job run once a day. Then I select from SQL Server Management Studio => Jobs => Select…
George2
  • 44,761
  • 110
  • 317
  • 455
3
votes
5 answers

Create SQL Server job automatically

I am writing SQL Server deployment scripts which create SQL Server job automatically on a specific SQL Server server/instance. I have found that I can extract the sql statement which can be used to create SQL Server job automatically by using script…
George2
  • 44,761
  • 110
  • 317
  • 455
3
votes
1 answer

How to handle SQL Agent job error?

I am writing a SQL Agent Job to remove rows from Table 1 and Table 2 once a day. The step of the SQL Agent job is: Delete some specific records from Table 1 Delete some specific records from Table 2. My question is: How to record the error during…
George2
  • 44,761
  • 110
  • 317
  • 455
3
votes
1 answer

Run a 32 bit Powershell script on Sql Server Agent

I have a powershell script that runs a 32 bit com object so when I run it in Powershell 64x it fails but runs fine in 86x When I run it in a Sql Server Agent job it has the same 64x failure. Is there a way around this? Like SSIS packages?
Chris Hayes
  • 3,876
  • 7
  • 42
  • 72
2
votes
3 answers

SQL Server Job - The system cannot find the file specified

I am running a SQL Server Agent job which zips up my database backups. The application I run is a C# Windows Application which takes in the path of the database as an argument. When I run the application form a command prompt all works well. However…
Cragly
  • 3,554
  • 9
  • 45
  • 59