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
1 answer
36 views

Sql server agent job question - maximum run time

How long can a SQL server agent job can run in general? are there any maximum run time limit settings option while creating a job ?
user avatar
  • 11
3 votes
2 answers
353 views

Why does this query fail when I run it from a SQL Server job?

I know how to solve the issue, but I don't understand the technicality of why the below query would work when I run it from SSMS, but the same query fails when I add it as a job in the SQL Server ...
user avatar
  • 78
-1 votes
2 answers
115 views

SQL Server Agent not running SSIS package

I have followed many articles to create an SSIS pipeline package, deploy it and schedule it. I'm trying to transfer data from two remote servers, an OLEDB driver that connects to a SQL Server Database ...
user avatar
0 votes
0 answers
62 views

SSIS and SQL Agent job impersonation

I currently have a new SSIS machine. SSIS is used to automate maintenance task such as backups and restores of other servers on the network. We have over 600 servers in our line of business and each ...
user avatar
0 votes
1 answer
23 views

Stop Changes to Maintenance Plan from Renaming Linked SQL Agent Job

Is there a way to stop a SQL job (which calls a maintenance plan) from being renamed every time i open and save that maintenance plan? Each time i do that, a prefix of "_SubPlan" gets added ...
user avatar
0 votes
4 answers
76 views

SQL Agent Job - Change all job steps to go to a specific step when the job fails

I have a SQL Agent Job that I need to change, so that any time any step fails the 'ON FAILURE' action goes to a specific step. Does anyone have a script or can you show me how to write this so that I ...
user avatar
0 votes
1 answer
137 views

SQL Agent Job error

It may be really simple question, but at the moment I have a kind of mental loop and need your help to break it. SQL server 2016 is installed using a domain account. I didn't create an explicit login, ...
user avatar
0 votes
0 answers
28 views

Why can I not manually run more than one snapshot agent at a time

My organization has a SQL Server 2016 instance with multiple databases, and multiple publications/subscriptions for each database, in a transactional replication set-up. Occasionally, we need to ...
user avatar
  • 1
0 votes
1 answer
37 views

Scheduling Next Run date for weekly agent jobs

On SQL Server I used maintenance plan wizard to create three jobs: Job Schedule Job 1 Every 3 week on Sunday Job 2 Every 3 week on Sunday Job 3 Every 3 week on Sunday I want the three jobs to run ...
user avatar
  • 411
4 votes
2 answers
233 views

Suppressing SQL Server Management Studio's 'Messages' from output of SQLCMD via SQL Server Agent

I've created a script that outputs data in an XML format, and was using SQL Server Agent (Job Step of Type 'Operating System (cmdexec)') to run a job monthly/quarterly to output the data to a specific ...
user avatar
0 votes
0 answers
27 views

emails sent by a phantom job: find a sender job

Every night at the same time I receive some mails like that: DESCRIPTION: Error: 50000 Severity: 16 State: 1 [ERROR]:DWHDumpProcess_XXX job is either failed or not in good state. Please check. Return ...
user avatar
0 votes
0 answers
11 views

enable job results in a sp_send_dbmail error

On one of our production servers (SQL SERVER 2017 Enterprise) I get the following error whenever I right click and enable a Job in the SQL Server Agent: Alter failed for Job 'My Job'. (Microsoft....
user avatar
  • 2,069
1 vote
2 answers
165 views

Find Agent job name from PROGRAM_NAME in sys.dm_exec_sessions

I would like to find the name of an Agent job, but e.g. Select login_name, program_name, host_name, nt_domain, nt_user_name From sys.dm_exec_sessions Does not show the ...
user avatar
  • 585
0 votes
1 answer
181 views

DBCC CHECKDB job failed on SQL Server 2014

We have a DBCC CHECKDB job that runs weekly on Saturdays. This job was created thorugh Maintenance Plan wizard. Typical duration for this job is 1.5 hours. This past weekend the job failed with the ...
user avatar
0 votes
1 answer
197 views

SQL Server create cron job without SQL Server Agent

I'm creating a cron job on SQL Server. As per my knowledge, the only way possible to create a job is through SQL Server Agent. However, the services(listed on services.msc) of VM assigned to me do not ...
user avatar
  • 13
0 votes
0 answers
81 views

Sql Job Failing with Timeout Error

Recently I have noticed that a job is failing on our Production 2014 SQL Server with this error text: Timeout error [258]. [SQLSTATE 42000] (Error 258) OLE DB provider "SQLNCLI11" for ...
user avatar
1 vote
0 answers
61 views

SSIS and SQL Agent - running jobs using proxy vs using MSA

We have multiple servers, each with its own SQL Server instance. We have external companies that develop applications for us. This companies deploy SSIS packages and run them via SQL Agent. I'm ...
user avatar
  • 141
0 votes
2 answers
73 views

Does changing database growth rate force a new execution plan?

For many years there has been a long running SQL Agent job that has taken nearly two hours to complete. Approximately two weeks ago on a slight whim a decision was made to change the growth rate on ...
user avatar
0 votes
0 answers
71 views

Stored Procedure fails on tempdb-diskspace when executed by SQL Agent

I developed a bunch of ETL procedures which are executed by an overlaying SQL Script and write Data to separate DB. The Script uses a single Transaction, ensuring we only get complete data. This ...
user avatar
1 vote
0 answers
100 views

Sql Server Agent Job - Unable to start execution of step 1 (reason: Error authenticating proxy "user", system error: The user's account has expired.)

My predecessor created several "Intergration Services Catalogs" dtsx packages which are scheduled / run via SQL Server Agent -> Jobs using an SSISFileProxy which is using ...
user avatar
0 votes
2 answers
293 views

SQL Server Agent Not Executing Job

We tried to schedule job in Sql server to take database backup. But it has been failed to execute. While checking logs we could see 2 different errors. SQL Agent error logs Error,[382] Logon to ...
user avatar
1 vote
1 answer
39 views

Where can I find sql server agent service logs?

I am using SQL server 2014. I notice that - occasionally, the sql server agent service gets automatically stopped. Where can I find logs to check the timing of when the service stop has happened and ...
user avatar
  • 2,050
2 votes
1 answer
153 views

Job to stop other job at specific time

We have a job which imports data daily from a remote SQL Server every night, I'll call it Import-Job. Most of the time this job runs through in about 15 minutes and everything is fine but due to a ...
user avatar
  • 33
0 votes
0 answers
45 views

Sql Error Message ID 3013 & 4305 for Standby / Read-Only database that we use for import data heavily

Sorry. I am not a DBA, but a SQL Developer, so I am trying to get some general support/feedback on my case (and when I Googled the issue, remedy seems so scattered so I decided to post here). I got ...
user avatar
  • 195
0 votes
0 answers
261 views

Permissions to run SQL Server Agent Job

I am getting the following error message: Message Executed as user: fin\jdoe. The server principal "fin\jdoe" is not able to access the database "abc" under the current security ...
user avatar
0 votes
1 answer
198 views

Run T-SQL Script Using Powershell via SQL Agent Job

Tried to think of the best subject title; however having a problem getting this done. I'll give my preferred way, but open to any best method to get this done. I have a tsql script that is done, ...
user avatar
0 votes
1 answer
99 views

SQL job sending email even if not configured to send notifications

I am using this version of SQL Server. Microsoft SQL Server 2016 (SP2-CU12) (KB4536648) - 13.0.5698.0 (X64) Feb 15 2020 01:47:30 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on ...
user avatar
2 votes
1 answer
166 views

SQL Agent stopped recording history (SQL Server 2017)

I have a Dev server that has been running without issue for at least 2 years. This dev machine was a VM Clone of the Production server. On 2021-06-05 something happened on this server that altered ...
user avatar
0 votes
0 answers
51 views

Phantom SQL Agent Job - Reports Running But Isn't Actully Doing Anything

I have a very similar issue to what is presented here. Periodically on one of my production servers a SQL agent job of some sort (that are responsible for calling several EXE's) will report running ...
user avatar
1 vote
1 answer
776 views

Security best practices for SSIS package execution via SQL Agent job

We're trying to rein in the number of sysadmins on our servers, and one of the issues we're running into pertains to SQL Agent security -- especially with regard to SSIS jobs and our ETL team. I ...
user avatar
2 votes
2 answers
40 views

In a mirror, how can I keep the SQL Server Agent offline, but have it start automatically in the event of a failover on the Principal?

In this scenario there are three MS SQL servers. ServerA has a series of jobs that write data to databases on ServerB. I want to set up ServerC as a mirror of ServerA, with all the same jobs available....
user avatar
  • 21
2 votes
1 answer
57 views

Jobs on the Mirror are running against the Primary

I have a mirrored set of jobs between the my current primary and mirrored failover SQL Server setup. In the past, the jobs on the mirrored server, when they are enabled, fail as they are not able to ...
user avatar
  • 1,731
0 votes
1 answer
31 views

Missing Target Local Server in Job

SQL Server 2016 Enterprise, CU15 + GDR. Client recently started using OPCON in production and I noticed that when OPCON creates jobs, it doesn't add the Local Server as the target. This prevents the ...
user avatar
  • 9,458
-1 votes
1 answer
100 views

How to kill agent job if it does not finish after x min

I want to create an agent job and collect some data on my server, e.g. every 10 minutes. But I would like to kill the job if it does not finish within a specified time period, e.g. after 5 min. I have ...
user avatar
  • 585
0 votes
0 answers
26 views

Aborting long running query under AG configuration [duplicate]

Currently we have a process where any query running over 2 mins (only select) in primary database participating in db mirroring is killed, running every 5 mins. As we have moved to Availability groups ...
user avatar
  • 2,117
1 vote
1 answer
853 views

SSMS Not showing Status and Scheduled Jobs Not Running

Recently in SSMS, I have started getting a blue question mark next to the database and SQL Server Agent, when previously all was showing running. At the same time my scheduled jobs have stopped ...
user avatar
0 votes
3 answers
547 views

SQL Server Agent & sp_send_dbmail failing on permissions

I have set up a SQL Server Agent job to call sp_send_dbmail with a very simple select on a certain table in a certain database. Within the properties > permissions of the target database, the ...
user avatar
  • 123
-1 votes
2 answers
54 views

Rebuild Indexes [duplicate]

We have a database named WSS_Us_App in our Production SQL Server 2014. In this database all of the indexes need to be rebuilt as most have a fragmentation level greater than 50%. I plan to rebuild ...
user avatar
2 votes
1 answer
181 views

Can't take backup to the shared folder

Need your help. My sql job is not able to take backup to the shared folder although the domain account, under which the sql agent service account is running, has full permission on that shared folder. ...
user avatar
  • 1,163
1 vote
2 answers
53 views

SQL SERVER Detailed Backup Report

I need to create a script that gives the report for the following information: Backup Job Name Databases that have been backed up in the last 24 hours Size of each DB backup Start time of backup End ...
user avatar
0 votes
2 answers
83 views

How to get job start time inside of a TSQL agent job step?

Is there a good way to query the job start time inside of a given sql agent job step (TSQL)? This will help with step 3 in the following scenario. Job Foo (Run Daily @ 11:30pm) Step1 - StartTime = ...
user avatar
1 vote
1 answer
182 views

Query agent jobs for a given notification operator name

Is there a good way to query sql agent jobs for success / failure notification to a given operator name? One of the operators is no longer with the company and need to fix up all agent jobs sending ...
user avatar
0 votes
1 answer
200 views

Global Temp Table Error when Stored Proc run by SQL Job on a Schedule

I have a puzzling situation I am trying to confirm/solve. A stored procedure I have written creates a series of Global Temp Tables and fires off an email if any records show up in the final one. This ...
user avatar
0 votes
1 answer
69 views

Report server scheduled job location

I inherited a SQL Server environment. In (database engine) SQL Server Agent are two jobs defined that apparently belong to the report server. First and only step in the first job: exec [ReportServer]....
user avatar
  • 101
0 votes
1 answer
165 views

Only a sysadmin can specify '@output_file_name'

I have developed an async batch system using the Agent Jobs in SQL Server 2017. It is working really well. I have one issue with setting up the operations staff to run this. We get the following error ...
user avatar
1 vote
1 answer
139 views

Which server actually runs the SSIS package when SQL Agent and SSISDB are on 2 different servers

We have a SQL Server where we deployed the SSIS packages to its Integration Service Catalog (SSIS DB). And we have another SQL Server where we scheduled SQL Agent to run those SSIS packages. My ...
user avatar
0 votes
1 answer
492 views

sp_update_schedule says @schedule_id does not exist

I wrote a script that reads job schedules from msdb.dbo.sysschedules and runs sp_update_schedule to change the active_start_time for a given subset of jobs. In each case, sp_update_schedule fails with ...
user avatar
  • 820
1 vote
2 answers
237 views

Halting a multi-step Agent job without resorting to "Quit the job reporting success"?

I have a multi-step process that sometime should stop in the middle, not because of any failure but for business reasons which are not failures. How can I tell Agent to successfully exit the whole job?...
user avatar
  • 455
0 votes
1 answer
101 views

SQL Server 2016 -number of SQL agent replication jobs(transaction log repl)

So I have a SQL server 2016 on a Windows Server 2012 instance. We have 140 databases(small to med). So the SQL instance was setup for self replication and in the process we have 140 SQL agent ...
user avatar
1 vote
1 answer
242 views

SQL Server Agent Alerts and Severity Errors

I've setup alerts in SQL Agent for errors of severity level 15-16 for testing, and found out that these are not always triggered To be more exact, these seem to trigger only when given error number ...
user avatar

1
2 3 4 5
11