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

SMSS shows job in msdb but not under SQL Server agent

I have a stored procedure that starts a job. When I go to [Databases] -> [System Databses] -> [msdb] -> [Tables] -> [System Tables] I can see the job in [dbo].[sysjobs] and everything related to this job is there in the msdb tables, and I've tested…
2
votes
1 answer

Powershell SQL Server Agent CmdExec job step multiple line code

Why does code like this execute in PowerShell ISE: $var = 'dog';Invoke-SqlCmd -ServerInstance 'servername' -Query "insert into DB.dbo.tbl values ('$($var)')" But not in SQL Server Agent as a CmdExec job step? Despite enclosing it as per usual. I…
beehive
  • 93
  • 3
  • 11
2
votes
1 answer

Show list of SQL Server Agent operators in a query

How can I see (with a query) the list of operators of SQL Server Agent with their e-mail address? I am asking it because i want to put more than one e-mail address and I used the msdb.dbo.sp_update_operator construct as described here, but…
Nicolaesse
  • 2,554
  • 12
  • 46
  • 71
2
votes
1 answer

In the context of SQL server agent, what is a job server?

When you script a SQL agent job, there will be a sp_add_jobserver invocation in the script. I checked the documentation about this stored procedure but still can't understand what is a job server. As I understand, when you create a job, you are…
Just a learner
  • 26,690
  • 50
  • 155
  • 234
2
votes
2 answers

SQL Server 2016: create credential and add SQL Server Agent proxy for it

I'm trying to script a creation of SQL Server identity to be then used to execute SQL Server agent jobs via a proxy. It looks as though I can only use a Windows account and thence I would have to provide its password in plain text. Seriously? There…
Ruslan
  • 9,927
  • 15
  • 55
  • 89
2
votes
3 answers

Deploying SSIS Package and retaining a connection password

I have an SSIS package that queries a view for some records then sends off an email using Database mail. I want to deploy the package to the SQL Server that these views exist in and then schedule us using SQL Server Agent but i've run into a number…
JoshReedSchramm
  • 2,751
  • 1
  • 27
  • 45
2
votes
0 answers

SSMS - SSRS job returns after deletion

we have several SSRS reports that we want to run at night. Every time we create a subscription, SSRS creates a job with its own schedule and one step in the job for example: exec [ReportServer].dbo.AddEvent @EventType='TimedSubscription',…
Daniel227
  • 127
  • 9
2
votes
1 answer

Finding the right SQL report

I know that I've used it before but I cannot find it now. I have several SQL Server Agent jobs that run. Some of them fail, but the error messages in the History are not very helpful. I found a report that helped, but now I cannot remember where I…
Mike
  • 1,853
  • 3
  • 45
  • 75
2
votes
3 answers

SQLSTATE 01000 in SQL Server job output

I've got SQL Server jobs running that include periodic 'print' statements so that I can look in the job history and get a sense of what happened. But the output is cluttered with [SQLSTATE 01000]. Given that there is a limit to how much will fit…
Clyde
  • 8,017
  • 11
  • 56
  • 87
2
votes
1 answer

Monitor biztalk server(biztalkmgmtdb) sql agent job failed on step 2 - Part1

In BizTalk Server 2013 R2 there's a job called Monitor BizTalk Server (BizTalkMgmtDb). This job checks the management and tracking databases and looks for any inconsistencies. If there are none then the job completes successfully. If there are…
Dipen Patel
  • 310
  • 3
  • 17
2
votes
1 answer

Parser NULL (DTEParseMgd) error when trying to set up SSIS package job

Whenever I try to set up a SQL Server Integration Services Package job (through the SSIS Catalog within SSMS), I get the error Parser NULL (DTEParseMgd). The version of the SQL server is "Microsoft SQL Server 2016 (SP1-GDR) (KB3210089) -…
Carther
  • 43
  • 4
2
votes
1 answer

Execute SQL task works in developer and SSMS but errors out in SQL Server Agent

This code works in the SSIS editor, SSMS and running from the catalog. Here is the code: declare @maxDate as date select @maxDate = cast(max([Date]) as date) from [dbo].[sometable] --print @maxDate declare @currDate as date select @currDate =…
Kevin
  • 21
  • 1
2
votes
0 answers

SQL Server Agent (2012) Inserting Quotes Into SSIS Parameters

I have a SQL Server Agent Job that is running an SSIS package and passing in a project-level parameter. The parameter value I typed in is: C:\Program Files (x86)\7-Zip\7z.exe The package was giving me an "invalid characters" error so I added a step…
2
votes
0 answers

Automatically stop SQL Server Agent when no jobs are running

I have around 40 different SQL Server jobs in one instance. They all have different schedules. Some run once a day some every two mins some every five mins. If I have a need to stop SQL Server Agent, how can I find the best time when no jobs are…
Ilyes
  • 14,640
  • 4
  • 29
  • 55
2
votes
2 answers

how to start a sql server agent job from java code

I have few SQL Server Agent Jobs running in my project. The jobs run perfectly as scheduled, no issues. But now I need to be able to start these jobs from the front end (Like on a click of button or so). How can I do it ? Do these jobs behave…
oceandrive
  • 41
  • 1
  • 2