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
4
votes
5 answers

SSIS package not running when called as step in SQL Job

I have a .dtsx file (an SSIS package) that downloads files from an FTP server and imports data. It runs fine whenever I run it manually. However, when I schedule calling the package as a step in a SQL server agent job, it fails. The step it fails at…
Pamela
  • 255
  • 2
  • 5
  • 14
4
votes
0 answers

SQL Server Agent Job stops SSIS Step with "unexpected error" and without any error informations

I am dealing with my problem on some Windows Server 2019 (Core) with one running SQL Server 2019 CU4 instance each. What we try to do We are currently building a data warehouse with distributed databases. The individual layers of the DWH are…
4
votes
2 answers

SSIS Server Maintenance Job error

I receive following error message in sql server 2017 agent jobs for Maintenance job that is responsible for deleting old execution logs: Date 5/23/2018 12:18:45 AM Log Job History (SSIS Server Maintenance Job) Step ID 1 Server …
VahidSH
  • 81
  • 7
4
votes
1 answer

Retrieving messages printed during sp_executesql

I am running a command through sp_executesql in a SQL Server Agent. How do I capture messages from this command so I can log them in a table? In particular I am attempting to truncate the database log and would like to be able to see if this…
aggaton
  • 3,066
  • 2
  • 25
  • 36
4
votes
1 answer

How to set up SQL server Agent? not showing in Sql Server Management

I am trying to set up the SQL Server Agent on our test server running with windows Small Business Server 2011 Standard and SQL Server 2008 R2 RTM. The Sql Server Agent node is not displayed in Sql management studio. Here is what I know according to…
Greg
  • 640
  • 5
  • 11
  • 23
4
votes
1 answer

How to properly return error message from Console to SQL Server Agent

I have a C# Console application that will be run from SQL Server agent. If the console application fail, i would like to have the error message shown in the SQL Server agent history log. But it doesnt seem to grab anything from the console app. It…
Alexandre Jobin
  • 2,811
  • 4
  • 33
  • 43
4
votes
3 answers

transactional replication using script

I am able to configure transactional replication using SSMS and it works properly. But i want to configure it using script so that i use it from my c#/vb application. Is there any way to do that?
4
votes
2 answers

How do I create a SQL Server agent without using a GUI?

I am using Angel LMS and its built on a SQL Server platform. I believe its 2005, but not 100% sure about that. Anyway, maybe my pseudo-code will shed light on that answer. Also single quotes must be used for strings and the concatenate character…
CheeseConQueso
  • 5,831
  • 29
  • 93
  • 126
4
votes
1 answer

How to catch the exit code of a CMDEXEC SQL Server Job?

The following SQL Server job always exits with return code 0 indicating success, when in fact it does not do its job, i.e. it does not delete "test.txt". How can I catch the actual exit code (something like %ERRORLEVEL%, or a 'permission…
4
votes
2 answers

SQL Server agent job account issue

I am using SQL Server 2008. I am confused about which account will be used when a SQL Server agent job runs. My confusions are, SQL Server agent as a Windows Service which we could control from Windows Service Management Console, from there we…
George2
  • 44,761
  • 110
  • 317
  • 455
4
votes
2 answers

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 msdb.dbo.sp_start_job N'TEST1'. The sp_start_job…
Josien
  • 13,079
  • 5
  • 36
  • 53
3
votes
1 answer

Execute SSIS package with Proxy - Could not get proxy data for Proxy_id

I am trying to execute an SSIS package using a Credential and Proxy - it works fine with a user with a SysAdmin role and we want to avoid using SysAdmin. I have followed all the steps to create a Credential and Proxy and set up the permissions for…
Ram
  • 527
  • 1
  • 10
  • 26
3
votes
1 answer

SQL Server Agent Job is not running

I have a job that is supposed to run every 11 AM and 8 PM. About two weeks ago, it started to not respect the schedule. The "fix" that I found was to start the job manually and then the job would restart respecting the schedule for a while but…
Hugo
  • 567
  • 1
  • 8
  • 18
3
votes
1 answer

Error in SQL Server Agent: "the conversation of a varchar data type to a datetime data type resulted in an out-of-range.""

I created a small script that works in SQL Server Management Studio, then I created a SQL Server Agent job with that same script; but after I run it, I get an error: The conversation of a varchar data type to a datetime data type resulted in an…
Sacamoto
  • 107
  • 1
  • 8
3
votes
1 answer

(SQL) Server Agent Job not stopping

I am using SQL Server 2016, and have some Jobs running in the SQL Server Agent. Today I found one of the job is taking too long (10hours!) to run and is still processing, so I try to stop that. I tried right-click and stop the job, it showed a…
J.Cheuk
  • 93
  • 1
  • 2
  • 8