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
2
votes
1 answer

Replication merge agent: String or binary data would be truncated

I am trying to setup output log for a replication merge agent on SQL Server 2012 by specifying the following parameter at the end of the Run agent step -Output C:\ReplOutput.txt Now when I run the agent again it fails and shows below error String…
Bat_Programmer
  • 6,717
  • 10
  • 56
  • 67
2
votes
0 answers

How to run a Powershell Script block with elevated privileges

I am writing a PowerShell script to archive compressed C2 Audit files to a file share. What is possibly the last problem I am having is giving the .Net compression routine the privilege to manipulate the files. During development, I could flaunt my…
2
votes
4 answers

SSIS package does nothing when invoked by agent

SSIS package loops through input files. For each file, flatfile parse adds records to a DB table, then file is renames/moved for archiving. After all files, package calls a sproc to delete all year-old records. Package runs from visual studio OK. …
WGroleau
  • 448
  • 1
  • 9
  • 26
2
votes
1 answer

Dynamic Job Schedule in SQL 2014

I have a SQL job that I have been trying to configure to run between a certain time (4pm - 7pm). I created the job I want to run between this time (lets call it DynJob). I set it a default schedule with the days I want it to run, and a default time…
Christopher
  • 790
  • 12
  • 30
2
votes
1 answer

COMMIT has no BEGIN error only when run as scheduled job?

I have a stored procedure in SQL Server that purges records from a table, committing every 5000: DECLARE AuditEventCursor CURSOR FOR SELECT E.EVENT_ID FROM XI31AUDIT2..AUDIT_EVENT E WHERE E.START_TIMESTAMP < GETDATE() - 14; DECLARE…
Paul
  • 3,725
  • 12
  • 50
  • 86
2
votes
2 answers

How do I read project connections in ssis from SQL Server Agent Job?

I am trying to run my SSIS Package via SQL Server Agent Jobs. In the SSIS Project I have Connections to My SQL Database as PROJECT Connections. I have set them up like this as all Packages call this connection. However when running it in SQL Server…
Bal
  • 81
  • 1
  • 1
  • 6
2
votes
3 answers

Powershell Transcript is empty when running script from SQL Agent Job in 2005 SQL Server

I have a complex Powershell script that gets run as part of a SQL 2005 Server Agent Job. The script works fine, but it uses the "Start-Transcript $strLogfile -Append" command to log all of it's actions to a transcript file. The problem is that the…
Greg Bray
  • 14,929
  • 12
  • 80
  • 104
2
votes
2 answers

How to implement SQL Server Job that waits to another job finish?

I'm looking a way to implement a precedence step on SQL Server Agent that will verify is a specific job is running. If so, the step will entry in a "wait" state until first job finish with success. To clarify, this will be the cenario: Job Name: 'My…
Fernando
  • 21
  • 2
2
votes
1 answer

Sending a summary of SQL Server Agent job failures

SQL Server Agent allows you to create Notifications at the moment a Job succeeds or fails, but I'd like to create a regular notification that sends a summary of the events for those who are one step removed from server maintenance. Is there a way to…
Feckmore
  • 4,322
  • 6
  • 43
  • 51
2
votes
0 answers

MSSQL Backup Immediately Suspended [BULKOP_BACKUP_DB]

Our production database server has stopped running the backup maintance plans... The server has plenty of space, upon googling and futher investigation it appears the backups are being halted they moment they are started. Running "Select * from…
2
votes
3 answers

SQL Agent Job - Connection may not be configured correctly or you may not have the right permissions on this connection?

I'm getting this error when running an SSIS package through SQL Agent Failed to acquire connection "ORACLE ADO.NET". Connection may not be configured correctly or you may not have the right permissions on this connection. When I log on as the SQL…
James Wiseman
  • 29,946
  • 17
  • 95
  • 158
2
votes
3 answers

Using an SQL Agent Job to call procedures in a loop

I am putting together a job on SQL Enterprise Manager 2000 to copy and delete records in a couple database tables. We've run a straight up mass copy and delete stored procedure, but it could be running it on millions of rows, and therefore hangs the…
Kevin
  • 1,300
  • 5
  • 18
  • 35
2
votes
1 answer

How to start SQL Server agent jobs automatically

I am writing PowerShell scripts to control SQL Server agent start/stop to ensure all the contained jobs runs according to defined schedule. I want to make sure that the only thing I need to do is to start the SQL Server Agent Windows Service, and…
George2
  • 44,761
  • 110
  • 317
  • 455
2
votes
1 answer

how to record both success and fail in SQL Server Agent Job

I am using SQL Server 2008 and I am writing a SQL Server Agent Job. In my Job, there are 3 steps and in each step I will execute a store procedure. I noticed that in default Notification setting, it write information to Windows event log only when…
George2
  • 44,761
  • 110
  • 317
  • 455
2
votes
3 answers

Any solutions to test SQL Agent Job immediately to ignore schedule

I am using SQL Server 2008 and I want to test the execution correctness of my SQL Server Agent job immediately to ignore the schedule. Any ideas? thanks in advance, George
George2
  • 44,761
  • 110
  • 317
  • 455