Questions tagged [sql-job]

A job is a specified series of operations performed sequentially

Jobs define an administrative task that can be executed one or more times (manually or via a schedule) and monitored for success or failure each time it executes

272 questions
149
votes
6 answers

How can I schedule a job to run a SQL query daily?

I need to know how to make a SQL query run daily using a SQL Server Agent job, with minimum required configuration settings.
Bobj-C
  • 5,276
  • 9
  • 47
  • 83
89
votes
3 answers

How to create jobs in SQL Server Express edition

Could anyone please explain to me how to create jobs in SQL Server Express edition?
Pearl
  • 901
  • 1
  • 8
  • 8
68
votes
3 answers

SQL Server Agent Job - Exists then Drop?

How can I drop sql server agent jobs, if (and only if) it exists? This is a well functioning script for stored procedures. How can I do the same to sql server agent jobs? if exists (select * from dbo.sysobjects where id =…
madcolor
  • 8,105
  • 11
  • 51
  • 74
36
votes
6 answers

How can I schedule a SQL job in Microsoft Azure SQL Database?

I have one SQL Agent maintenance job which checks the index fragmentation within a database and rebuilds indexes if required. This is running well in my test server (Microsoft Sql Server 2012). But my production server is in Azure. Now I want to…
user1006544
  • 1,514
  • 2
  • 16
  • 26
29
votes
4 answers

How can I view full SQL Job History?

In SQL Server Management Studio, when I "View History" for a SQL Job, I'm only shown the last 50 executions of the Job. How can I view a full log of every execution of a SQL Job since it was created on the server?
Curtis
  • 101,612
  • 66
  • 270
  • 352
19
votes
1 answer

SQL Server Agent not running

None of the SQL Jobs on my server are running. I've looked into this and got the message: SQLServerAgent is not currently running so it cannot be notified of this action How can I get SQL Server Agent to start running on SQL Server 2008?
Curtis
  • 101,612
  • 66
  • 270
  • 352
13
votes
4 answers

What do the Categories in SQL Server Agent Jobs mean?

This is the first time I am trying for the SQL Job Agent...I was trying to create the sample job and I got struck in between when it came to select the Category as highlighted in the below screen shot I am new to SQL Server can you explain the…
Pankaj
  • 9,749
  • 32
  • 139
  • 283
10
votes
5 answers

Parameter variables are read-only on SSIS package?

I defined parameters as shown below on my SSIS project then I would like to change those optional over my sql agent- job, i defined as below. even I tried to set a fix date value instead of getdate but It returns an error message telling me…
Emil
  • 6,411
  • 7
  • 62
  • 112
9
votes
3 answers

The SELECT permission was denied on the object 'sysjobs', database 'msdb', schema 'dbo'

I'm getting the following error when trying to read a SQL Job. The SELECT permission was denied on the object 'sysjobs', database 'msdb', schema 'dbo' How can I fix this?
Curtis
  • 101,612
  • 66
  • 270
  • 352
8
votes
2 answers

SQL Job executing SSIS - Could not complete cursor operation because the table schema changed after the cursor was declared

I have been trying to get this issue resolved for a couple of days but none of the issues when searching on the web directly explains why I am getting this error as there is no cursor being executed on this package. I have a SQL Job which executes a…
PKirby
  • 859
  • 3
  • 16
  • 36
7
votes
3 answers

Detect jobs that haven't run as scheduled

I am trying to write a SQL query which tell me if a SQL job has run or not based on its schedule. For instance, if a job was planned to run at 12:00PM and we are 12:05PM and it still hasn't run, I want to know that. What would be the best approach…
Martin
  • 39,309
  • 62
  • 192
  • 278
6
votes
2 answers

How to get the value from step1 to step2 in sql Job

I need to create a SQL JOB. Step1: Insert a Row into TaskToProcess Table and return ProcessID(PK and Identity) Step2: Retrive the ProcessID which is generated in step1 and pass the value to SSIS package and execute the SSIS Package. Is this…
VInayK
  • 1,501
  • 6
  • 34
  • 47
6
votes
3 answers

Is there a way to set a SQL Server job scheduled to run every 30 seconds?

When I try to create a Schedule the minimum amount of time I can choose from is 1 minute, is there a way to reduce this to seconds?
Francisco Noriega
  • 13,725
  • 11
  • 47
  • 72
6
votes
5 answers

SQL Server Agent and SSIS packages

I'm trying to pass a variable value from SQL Server Agent job to SSIS package but the variable contains an apostrophe in it causing the SQL Server Agent job to fail e.g In SQL Server Agent at Job Step Properties I'm entering the following…
6
votes
5 answers

Schedule SQL Job in a user configured time intervals everyday

In my application (ASP.NET, C#), i need to run a stored procedure in a set of pre defined time interval(s) everyday. So that i created a sql job and scheduled the same. But the problem is, there is a option to create/modify this time intervals…
Abdul Rasheed
  • 6,486
  • 4
  • 32
  • 48
1
2 3
18 19