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
2
votes
0 answers

Trigger REST API when a new entry gets inserted into SQL table

So I want to push back the data that recently got inserted into my table to another server through REST API as soon as I get a new record into the SQL table. Because my client wants on the fly data updation to another server. I'm not sure what…
Shilpa Soni
  • 2,034
  • 4
  • 27
  • 38
2
votes
1 answer

Script works in Command Prompt but not in SQL Job using SQLCMD

I have a script that looks like: sqlcmd -S ServerName -d database -E -i "C:\Report1.sql" -o E:\Folder\SubFolder\FileDate_%date:~-4%_%date:~4,2%.csv -s"," -w 700 The purpose is to automagically run a .sql file and export the results to a .csv…
Paden S
  • 21
  • 2
2
votes
1 answer

does sp_delete_job also delete the associated job step?

does sp_delete_job also delete the associated job step?
Steve
  • 21
  • 1
2
votes
2 answers

PowerShell directly vs. SQL Agent PowerShell Job Steps

If I run this 3 line script in Powershell (Run As Administrator, and my domain account is a local administrator on MyRemoteServer), it works as expected (note that there is a dollar sign in the service name that I had to escape with a back…
Mark Freeman
  • 1,155
  • 3
  • 24
  • 42
2
votes
1 answer

SQL Job sql ssis job ERROR: "the package failed to load due to error 0xC0010014 this occurs when CPackage::LoadFROMXML fails

I created a SSIS Project in SQL Server Data Tools for Visual Studio 2013 now I tried to deploy it as an sql job in sql server 2008. I move the .dstx file and .dtsConfig to another folder. After selecting the file in the server this error message…
Vian Ojeda Garcia
  • 827
  • 4
  • 17
  • 34
2
votes
1 answer

Schedule a job to run only if another job is not currently running in Microsoft SQL Server Management Studio

Currently have 2 jobs that can't run in parallel. Is there a way I can defer the execution based on the status? So MAG_LOGICAR_D3_H should not run if MAG_LOGICAR_D3_M is currently running and vice versa using Microsoft SQL Server Management Studio…
C.Astraea
  • 185
  • 4
  • 16
2
votes
2 answers

SQLServer Jobhistory - last successful runtime & last unsuccessful runtime

I want to have a view about my sql jobs which contains name job_id run_date LastSuccessfulRunDate This is what I found for the last successful run dates. Works like a charm, but here I am, failing to add the last run date. Use msdb GO …
VJ87
  • 132
  • 2
  • 15
2
votes
0 answers

C# Excel Object reference not set to an instance of an object

I know there are many questions that say Object reference not set to an instance of an object but my question is different but gives the same error I am running this script in a SSIS package inside a Script task which builds and complies fine when…
user4410715
2
votes
1 answer

Calling web service from SQL Agent Job not working

I have a a SQL 2000 DTS package that is scheduled to run from a SQL 2005 SQL Agent job. In this DTS there is a ActiveX step that has the following VBScript to call a webservice. Dim http: set http = CreateObject("MSXML2.ServerXMLHTTP.6.0")…
MakkyNZ
  • 2,215
  • 5
  • 33
  • 53
2
votes
1 answer

Append output of sqlcmd to file using Job Agent

After some research I found the solution to append the output of a sqlcmd command to a csv file. Everything is fine when using the Command Shell: C:\temp>sqlcmd -S -d -E -Q "SELECT [something] FROM [TableX] WHERE [columnY] IS NOT…
D.C.
  • 83
  • 11
2
votes
1 answer

Select Statements in Jobs

I have inherited a few jobs and I am trying to understand why select statements would be in their steps. I would think that select statements would be pointless in an automated job that displays nothing for an end user.
Andrew Vogel
  • 266
  • 2
  • 4
  • 14
2
votes
1 answer

Stored procedure runs successfully but fails when called from a job

I'm running into a very bizarre error in SQL that I would like some help with. The code below creates the two stored procedures I need for this report: USE [ONDTTEST] SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE…
2
votes
1 answer

What happens to a SQL job if it doesn't finish?

Let's say there's a SQL job that runs a stored procedure every one minute. What happens, if it takes more than a minute? Does it start the procedure again (having 2 of them running in the same time) or it waits for the previous to finish?
Ash
  • 1,269
  • 3
  • 25
  • 49
2
votes
1 answer

Insert Data else Update FROM a CSV file?

I am currently using an SQL job to import the contents of a CSV file (BULK INSERT). I use a LEFT JOIN statement to check if there are duplicates and to not insert them if any are found. However, I would like to instead UPDATE a column if their are…
Saudate
  • 431
  • 2
  • 8
  • 14
2
votes
1 answer

sql job to run every certain time and execute a console application

I am trying to write a SQL job to run every 10 minutes and to execute a console application that I wrote in C#. It would be really helpful if someone could help.
ainFowara
  • 109
  • 2
  • 3
  • 6