Questions tagged [sql-agent-job]

this tag is used to discuss about the issues are occurred when add or modify the job steps, schedules, alerts, and notifications of sql server agent jobs.

SQL Server Agent job can be create in SQL Server by using SQL Server Management Studio, Transact-SQL, or SQL Server Management Objects (SMO).

421 questions
3
votes
0 answers

SQL Agent schedule in different time zones

I have a SQL Agent job running on a server using UTC time zone for a client in Eastern Daylight Savings (actually multiple clients across the US). I need the job schedule to 'adjust' appropriately for the client(s). I can calculate the difference…
Scott Duncan
  • 1,041
  • 1
  • 12
  • 22
3
votes
1 answer

Query to check if job already belongs to jobserver in SQL Server

I am working with a legacy migration script that was setup to add a job (with a number of steps) to a SQL Server. I am trying to build in some semblance of re-runable without it completely blowing up. However I am now down to this line : EXEC…
MindingData
  • 11,924
  • 6
  • 49
  • 68
3
votes
2 answers

In SQL Server Jobs Two stored procedures Execute one by one or simultaneously?

I want to create a JOB in SQL Server 2012, to execute two related stored procedures. Exec my_First_Procedure Exec my_Second_Procedure If I create the JOB like above, the second one start the execution after the first one completed, or both the…
DineshDB
  • 5,998
  • 7
  • 33
  • 49
3
votes
2 answers

What is the next run date of a new SQL Server Job?

I created a new SQL Server job which will run once a year, it's currently enabled and configured to run on 1st day of new year. In order to make sure configuration date is correct, I run this command: sp_help_jobschedule @job_name = 'MyJobName' It…
doganak
  • 798
  • 14
  • 31
3
votes
2 answers

Generating error full message in email when SQL agent job fail

I have 3 SQL Agent jobs that execute SSIS packages. When the job errors out, it generates an email that has 'The job failed - ' in subject and in the email has a message 'The job failed. The job was invoked by schedule schename, the last step to run…
Roger Dodger
  • 927
  • 2
  • 16
  • 37
3
votes
1 answer

SQL Job Step to Compare File Names

I have a folder which gets populated automatically with text files with names of SQL functions. I have another folder at a set location that has all the actual SQL functions in them. What I'm trying to do is come up with a SQL job that will look…
Aerobane
  • 85
  • 9
3
votes
1 answer

2012 SQL job problems

I'm have a horrible time with SQL 2012. I'm used to job scheduling and automation with SQL 2000 but I'm new to 2012. I've written a very basic script (see below) and no matter what I do the script fails as step one of the job, but works fine as a…
Keith
  • 111
  • 6
3
votes
1 answer

SSIS package fails in sql server agent, but not in visual studio. ODBC Connection

I have an SSIS package that runs fine in visual studio 2010, but as a job it sql server it fails when connecting to an ODBC database. The project encrypts sensitive data with a password. This is because the proxy server isn't my account. It also…
Jooooosh
  • 331
  • 2
  • 4
  • 13
3
votes
1 answer

SSIS Script Component or Script Task Write To Job History Log

I am using SQL server 2008 R2. I have a scheduled job that executes an SSIS Package - running in SQL Agent. I want to log messages that happen in the scheduled job. I want to log messages from Script Component or Script Task. I do not want to log…
Simcha Khabinsky
  • 1,970
  • 2
  • 19
  • 34
3
votes
2 answers

Powershell from SQL Server Agent Job doesn't recognize ConvertTo-CSV

UPDATE: Modified the script to work within the bounds of PS1 as required by SQLPS. Changed: IF($property.Value -match $regex){ $currentBadLine = (ConvertTo-Csv $_ -NoTypeInformation -Delimiter $delimiter); …
3
votes
4 answers

Create failed for Job 'SSIS Package Exec'

I created an SSIS package entitled "DimEntity.dtsx" I followed the instructions from this link to run this SSIS package using a scheduled Job. http://blog.sqlauthority.com/2011/05/23/sql-server-running-ssis-package-in-scheduled-job/ After following…
BA82283
  • 251
  • 4
  • 9
  • 22
3
votes
4 answers

Run SQL Agent Job in endless loop

There is an SQL Agent Job containing a complex Integration Services Package performing some ETL Jobs. It takes between 1 and 4 hours to run, depending on our data sources. The Job currently runs daily, without problems. What I would like to do now…
Thomas Tschernich
  • 1,264
  • 15
  • 29
3
votes
3 answers

Sql Server Agent Job - Adding Version Number

I created a monitoring tool using sql server 2008 r2 dmvs and dmfs. I created a sql server job for it via tsql with 9 steps to deployed it to the client site. My question is to find out a way to include a version stored with the job somehow so that…
user2041076
  • 119
  • 11
2
votes
1 answer

SQL Server Agent Adding a Parameter for a CmdExec

I want to add a parameter to a step that runs an operating system (CmdExec) in SQL Server Agent. I have searched everywhere and asked my coworkers and none of them had tried it before. I have attached a picture of the screen. I was thinking that I…
buzzzzjay
  • 1,140
  • 6
  • 27
  • 54
2
votes
2 answers

Inserting SQL Server view result to a table

I have a SQL Server view vwSales which returns all sales from yesterday. I want to dump the result into an actual table (tblSales) which needs to be recreated daily. How to implement it by creating a script and automate the running thru SQL Server…
Dion
  • 59
  • 5
1 2
3
28 29