Questions tagged [sql-server-agent]

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 potential.

Filter by
Sorted by
Tagged with
1
vote
2answers
20 views

Schedule Job to Start at Different Steps

I am working on a system that generates a number of recurring emails as parts of various jobs scheduled in SQL Server Agent. The emails contain text-based reports that are loosely associated to the ...
0
votes
1answer
66 views

How to run Sql Server stored procedure in Async mode?

Is there a way to run SQL Server 2019 stored procedures with parameters asynchronously? Calls to this SP will be made several times a day, i.e. this is not one time requirement. Service Broker can be ...
-1
votes
1answer
21 views

How does sql server agent access the azure storage blob [duplicate]

Good morning all , I must configure an automated backup to an azure blob storage in the backup script I have correctly configured the credential now what right is needed for the sql server agent ...
1
vote
1answer
15 views

How to fix SQL Agent Job using Windows Security after password change

I have some sql agent jobs that are using Windows NT Integrated Security to run (as specified in the Maintenance Plan's Manage Connections window)...eg. Translog backups. While logged in as this ...
0
votes
1answer
21 views

Where to find the whole log of a maintenance plan package job that failed with error?

I have a maintenance plan that runs on SQL Server agent as a the job and finishes with error. However the error is not visible in job history in SSMS, the text of Message is seemingly truncated. How ...
-1
votes
1answer
33 views

Complex SQL Agent Job

I would like to tun the Stored Procedures on the following dates. 1st sept 2020 1st Nov 2020 1st Dec 2020 1st Feb 2021 1st March 2021 1st May 2021 1st june 2021 1st august ...
0
votes
2answers
40 views

Grant an AD Group permission to edit all MSSQL Agent jobs

We have a team of people, we all log in MSSQL Server from SSMS using our Active Directory accounts, by Windows Authentication. Our AD accounts are added to an AD group, which is used to grant all ...
2
votes
1answer
26 views

User on SQLAgentOperatorRole unable to edit jobs

My Active Directory account is on an AD group that is on msdb's SQLAgentOperatorRole. I'm able to list existing MSSQL Agent jobs, but I can only view their steps and schedules, I'm unable to edit them ...
1
vote
1answer
46 views

SQL Server - Unable to Enlist Target to SQL Server Agent (MSX) after Collation Change

After changing the Collation of SQL Server to Latin1_General_CI_AI from QL_Latin1_General_CP1_CI_AS I'm trying to add the server back to MSX as target in CMS but Enlisting is failing. One thing I ...
0
votes
2answers
33 views

Is it possible to prevent SQL Agent Job from running if related job or previous instance has not finished?

I have three SQL Agent jobs, one for each of three registries being managed. These go off on a staggered schedule every two hours (i.e. Reg 1 at 9am, 3pm; Reg 2 at 11am, 5pm; Reg 3 at 1pm, 7pm). In ...
0
votes
1answer
44 views

SQL Server Agent unable to view network drives

I am unable to get agent jobs to output to a network path. I have pushed the IT guy to set up a domain authenticated user that logs in when the agent starts. That login does have access to the domain ...
0
votes
0answers
35 views

SQL Agent time travel

Can anyone explain why SQL Agent didn't run any jobs between 04:30 and 05:24... The previous execution at 04:30am completed in 8 seconds so it wasn't a long running job. The SQL Server was still up ...
0
votes
1answer
22 views

How to Capture Job Exit Code?

I'm essentially trying to find a better way to determine if my job has completed successfully before moving on to another call of the same job. I have multiple jobs which run through a parsing process ...
0
votes
2answers
38 views

Running queries/jobs via SMSS - SQL service and SQL agent service accounts (SQL Server)

If a command, for example the below command, is executed from SQL Server Management Studio while I am logged in the session with a windows authentication login, I understood that the access to the ...
0
votes
1answer
28 views

Chaining remote SQL Server Agent Jobs with success/failure feedback

I have 2 Microsoft SQL Server 2014 (SP3-CU4) instances, residing on different servers. ServerA has a linked server, pointing to ServerB\InstanceB. Both instances have a job, and JobA triggers the ...
0
votes
0answers
30 views

gMSA for running a sql agent job

I've had the question if it's possible to add a gMSA-account to the SQL-logins in order to let it perform a certain SQL Agent Job. I know it's possible to add a gMSA as a login but it will probably ...
2
votes
0answers
40 views

SQL Server 2016 Agent jobs start, but hang indefinitely on first run after a server bounce

I have multiple SQL Server Agent jobs that hang indefinitely upon first run after the server bounces. The jobs execute as scheduled, but never perform any action and stay in "Executing" status ...
-1
votes
1answer
31 views

SQL Job runs without it schedule and renaming or deleting it causes other jobs fail

I recently migrated the SQL 2008 to SQL Server 2016. I started noticing a strange issue where one of the SQL Job is causing the failure of other jobs. This job is disabled and there is no schedule and ...
0
votes
1answer
21 views

Granting access to users to run specific SQL jobs that runs SSIS packages [duplicate]

We need to grant a couple of users access to run only specific SQL jobs that runs SSIS packages. Is there a solution that can be used to accomplish this?
0
votes
1answer
32 views

Datepart logic for custom sql agent job schedule

Wanted help in code for below logic. Job A needs to be run on 8th of month. Job B needs to be run on Tuesday only. Job c needs to be run on Daily(Minus Tuesday & Sunday). And If Its Tuesday and ...
-2
votes
1answer
51 views

Using Ola Hallengren's backup solution - Can't exclude databases [closed]

I am using the newest version of Ola's scripts. When backing-up databases, I'm experiencing an issue with excluding certain databases. The website states, if you want to backup all User database ...
0
votes
0answers
60 views

Error while executing PowerShell script using SQL Server Agent Job

I am executing a PowerShell script using SQL Server Agent job, script code is given below(it is added as is in the Job step 1) : $OriginFile = "\\vmpr-file1\share3\RT-BI_Shared\ABC.xlsx" $SourceFile =...
0
votes
0answers
113 views

CDC capture Job Step-2 is not running when enabling CDC on table in SQL Server and Change table is empty

My Database has CDC enabled and the table i want to track changes using the below T-SQL, EXEC sys.sp_cdc_enable_db; GO EXEC sys.sp_cdc_enable_table @source_schema = N'dbo', @source_name = N'...
0
votes
1answer
93 views

How to copy a SQL Agent Job on same Server?

I want to make a few duplicate copies of an existing SQL Server Agent Job on the same server and edit them to do the same action on different databases that exist on the same server. These are ...
0
votes
1answer
82 views

What permissions does the SQL Agent's user need to execute Powershell scripts?

I'm trying to create a job with a Powershell step. To recreate this: create new job, give it a name add a new job step, name it, type powershell, run as the SQL Agent, script: $test="test" set the ...
0
votes
1answer
16 views

SQL Server Agent Job Next Run DateTime Stuck In The Past

The job is enabled, the schedule is enabled, the agent service is running, but the job is not running as it is supposed to. Looking in the Job Activity Monitor, it shows a Next Run that is actually in ...
0
votes
0answers
14 views

SQL Server and Agent Services not starting automatic in AZURE IaaS

We migrated an on-premise database to azure IaaS and the machines is on between 7am and 7pm that way we save money in the night when the users are not querying the database, but every time the machine ...
0
votes
0answers
29 views

Sql Agent Job: Behavior different than running on command line: starts new process vs. existing process

I'm using sql server agent job (sql server 2019 cu1) to execute a function in a third-party running program. From the command line it is simple: myProg.exe -myParam This will always activate the ...
0
votes
2answers
628 views

Execute sp_update_jobstep to change SQL Agent job step type

As I was going to deploy a change to our Ola Hallengren indexing scripts, I noticed on some SQL Servers we have indexing job running as an "Operating System (CmdExec)" step instead of being called as ...
1
vote
2answers
112 views

Is it better to have one instance of a continuously running agent job or to fire off the job multiple times throughout the day?

I have a SQL query I need to run every second for about 12 hours a day. It's a pretty simple query that logs some data to an isolated table. Right now I've been leaving it running in my local SSMS ...
2
votes
0answers
49 views

SQL Server Agent is not ending some jobs correctly

we observed a strange behaviour after migrating our datawarehouse from SQL Server 2012 to SQL Server 2019. Our Agent runs most of the jobs correctly after the migration. However there are a few were ...
0
votes
0answers
86 views

SQL Job get stuck on a simple Select into vaiables query

I have an issue that I please need help in trying to resolve as its really becoming a bit pain. I have some Jobs that monitor our systems for calls stuck and it's getting stuck (the irony is not lost ...
10
votes
3answers
2k views

SQL Server Agent fails after installing SQL Server 2019 CU2

After installing CU2 our SQL server agent randomly stops working. If you go to check on the status of the agent by opening Job Activity Monitor, it comes up blank for a while then throws an error: ...
0
votes
0answers
26 views

SQL Server Agent fails to start

I am replacing a SQL Server 2012 cluster with a new one (keeping the same version of SQL, changing OS from 2008R2 to 2012R2). I have 1 node installed so far, but the agent won't start. The error ...
0
votes
1answer
158 views

SQL Agent using domain user for Jobs with TSQL

I have tried every option but i still cant find out why my sql agent is using a domain user when executing job steps with TSQL and keep getting the following error: Executed as user: RESOURCE\...
2
votes
2answers
625 views

UPDATE failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER' in Agent job

In brief, I added a computed column to a table and then Agent jobs began failing and reporting the error: UPDATE failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'...
1
vote
2answers
74 views

SQL Server Agent crashes when scheduled procedures make select in DBLink on an offline Oracle database

I have SQL Server 2014 and I'm using SQL Server Agent to start some scheduled procedures during the day. These procedures make some selects (in DBlink) on an Oracle database that is handled by another ...
4
votes
1answer
456 views

Change character limit of SQL Agent Operators

I want to add more than 100 characters worth of email addresses to the SQL Agent Operators alerting. For example: emaione@example.com;emailtwo@example.com;emailthree@example.com;.... I tried to get ...
0
votes
1answer
34 views

Why does an SQL Server Agent job try to create a procedure

I am using SQL Agent to schedule the exeuction of a procedure. The first time that the procedure is executed, it runs without problems. The second time the job (step) executes, it does not finish. A ...
1
vote
1answer
198 views

SQL Server 2012 Agent hangs at a particular time of the day

There is a 3 node SQL Server Failover Cluster with 3 instances running on same node at the moment. SQL Server version is 2012 with SP3. At a particular time of the day at 4 PM daily, SQL Agent hangs ...
3
votes
1answer
515 views

SQL Server job stuck even after restart

I have a SQL Server Agent job stuck in "In Progress". It's a FULL backup that usually takes 30 minutes, but it's taking 7 hours and counting. I've restarted the Agent and then the whole OS and it ...
1
vote
2answers
83 views

Find jobs that succeeded, but had steps that failed

Is it possible to find jobs that succeeded, but that had steps that failed like the desired output shows? I'm new to this side of development and I'm not sure about all of the system tables, etc. If ...
1
vote
0answers
307 views

SQL Server Agent log is showing error [298] SQLServer Error: 16389, Communication link failure [SQLSTATE 08S01] (LogToTableWrite)

While checking SQL Server Agent Log i found lot of error like follows [298] SQLServer Error: 16389, Communication link failure [SQLSTATE 08S01] (LogToTableWrite) [298] SQLServer Error: 10004, ...
1
vote
0answers
72 views

Why is failed job not logged in SQL Server Agent Error Log?

I have a failed job which is logged in SQL Server Logs but not logged in SQL Server Agent Error Logs. The job is executed as user: NT SERVICE\SQLSERVERAGENT. Limit size of job history and Remove agent ...
4
votes
1answer
319 views

Why the job's next_run_time is wrong?

I got an issue regarding job stats. So I have a job with the following schedule: Occurs every day every 5 minute(s) between 12:00:00 AM and 11:59:59 PM. Schedule will be used starting on 12/13/2017. ...
0
votes
0answers
134 views

SQL Server Agent runs a job on one server, not on the other

I have two SQL servers, each running on their own Windows server. The versions of both Windows and SQL Server are the same, they are on the same domain, they're virtually identical. On these servers,...
1
vote
1answer
37 views

SQL Server Agent - Report Failure but continue When intermediate step fails

I have a SQL Server Agent job that has three steps with the following control flow: Step 1 - on success - Go to next Step. on fail - job fails Step 2 - on success - Go to next Step. on fail - Go to ...
0
votes
0answers
22 views

Takes several hours to commit data on my data warehouse what seems for only one table

I have a data warehouse which runs several jobs during the night in order to update data. Background and job execution(s) setup One of these jobs updates the FactSale table consisting of the sales. ...
1
vote
1answer
623 views

SQL Agent job for SSIS execution fails with “An invalid reporting option was specified. Only E, W, I, C, D, P, V, and N are allowed.”

A SQL Agent job with a SQL Server Integration Services Package step fails with the following message: Executed as user: DOMAIN\SQLAGENTACCOUNT. Microsoft (R) SQL Server Execute Package Utility ...
1
vote
0answers
85 views

SQL Server allow viewing of jobs by job category

I know how to assign or create "categories" for jobs. But is there a way to actually view jobs by category by default. I do not want to see all the jobs just listed within SQL Server Agent. I'd ...

1
2 3 4 5
10