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
0
votes
2 answers

Why does my Python script fail when I run it from SQL Server Agent?

I have a python script that works fine when I run it in an IDE. If I execute it from a command line, I have to be in the directory in which is resides in order for it to run properly. If I try to run it as an agent job or with an Execute Process…
0
votes
1 answer

Update existing SQL Server Agent job step's advanced property value using T-SQL

I have an existing job where every time I use it, I must go to the job's properties, edit the step (only one step exists), go to Configuration, click on the Advanced tab, edit the Property Override all just to manually edit the Property value. I'd…
Theway
  • 45
  • 6
0
votes
0 answers

SSIS Agent job fails when disconnecting from RDP Remote session with (X)

I have an SSIS package that takes an Excel document and refreshes the Queries and pivots within the document, then saves it and then sends it to a destination via "Send email task". So first of all the first issue was that the SSIS package runs…
Ruahl Behr
  • 31
  • 7
0
votes
0 answers

SQL Server 2012 Permission for bulk load are set, but still getting an error

I have a user that has bulk load permissions set at the server level. I am logged into the server as that user. I can execute a query containing a bulk load with no problems whatsoever. However, when I create a SQL Server Agent Job with that same…
0
votes
1 answer

sql job executing ssrs report shows success even if the report is stuck in deadlock

I have created an email subscription for SSRS report. When I execute the report by the Subscription, it shows the job successfully completed. But, the email is not received as the report is still executing, because one of the tables is in lock. Once…
paranjai
  • 531
  • 2
  • 5
  • 26
0
votes
1 answer

Create a stored procedure that generates SQL Server Agent jobs

Curious if this is feasible. I am currently in the process of building a number of SQL Server agent jobs. These jobs are just SFTP jobs that pass files between the servers of 2 different clients, making a pit-stop at my local server for some pre and…
Canadian_Marine
  • 479
  • 1
  • 4
  • 10
0
votes
1 answer

Execute As not impersonating permissions when trying to create sql server agent jobs programmatically

I am trying to create a stored procedure that creates a job and step programmatically and runs it. This works, but I also need to impersonate a user as the end-user will not have permission to do this. I have created a test user (sa2) and given it…
Paul
  • 693
  • 1
  • 10
  • 25
0
votes
0 answers

Automatically deleting a image when a certain SQL Server record is deleted

I have created a program with C# WinForms where the user enters personal information along with uploading an image of their choice, all the entered data is stored in a single SQL Server table while the image is stored in a folder that is located on…
simon
  • 19
  • 4
0
votes
0 answers

How to pass a parameter from a SQL Server Agent Job to a stored procedure

I have a stored procedure that I need to run for multiple locations. I have added a parameter in it for the LocationID, which is a string. I need help setting up a job step which passes it a location ID and outputs it to a path. Below is a…
kziaj930
  • 1
  • 2
0
votes
1 answer

The connection type "OLEDB"...not recognized as a valid connection manager type

I am sporadically experiencing the error message below with one of my SSIS packages. The package is run on a schedule by the SQL Server Agent. The error is basically stating that the connection type (OLEDB) is not valid. This error seems to occur…
0
votes
0 answers

SQL Server Agent Job executed but the log date show future time

I have a SQL Server(2014) Job scheduled run at "AM 11:00" on everyday. I saw the job's log at "2020/01/08 AM 11:40", the Windows server's clock tool displayed right. But I find out the job's last record executed at "2020/01/08 PM 06:12", I have no…
Mortiz.H
  • 1
  • 1
0
votes
2 answers

SQL Server agent failing: loop in ssis

I am daily running a SQL Server Agent Job, which contains a ssis-project with a loop, which tries to do a task, but max 3 times. So it happens, that the task needs 2 tries, this is totally fine. But the SQL Server Agents gives back the information,…
0
votes
1 answer

Use SQL Server Agent to schedule a job

I wrote a stored procedure and I need to schedule it to run monthly. I'm using SQL Server Management Studio 2015. In that Object Explorer it doesn't have SQL Server Agent. Anyone know about this and if it is not possible how to schedule stored…
0
votes
2 answers

Send email via SQL Server Agent, based on the result of a T-SQL stored procedure

I have a T-SQL stored procedure (which returns a single scalar value called @HourDifference as an output parameter); you can see the execution below: DECLARE @HourDifference_output TINYINT; -- I declare a variable to capture the output…
0
votes
1 answer

How to change the encoding of a file created by SQL Server Agent job to UTF-8?

I'm trying to create a daily job to query items inventory of my SAP db (SQL Server 17), save the results in a .txt file, and ftp it to my website server, where I'll parse it using PHP, and use it to update stock level on the MySQL db of the…
einav
  • 553
  • 9
  • 27