-
Abort SQL Server Agent job from a step
I have an SQL Server Agent Job that consists of 5 steps. The first step checks
to see if a file exists on disk. If it does, then it performs some manipulation
and continues with the next step. However, if the file does not exist, the
next step is still invoked and fails because it needs the file. How can I
exit a step with an error? ie. If file does not exist, then quit entire job.
-
Re: Abort SQL Server Agent job from a step
Control-of-flow is part of the job step creation. See "Define Jobs" in BOL.
"Shaun Higgins" <shiggins@businesspartners.co.za> wrote in message
news:38db6daf$1@news.devx.com...
>
> I have an SQL Server Agent Job that consists of 5 steps. The first step
checks
> to see if a file exists on disk. If it does, then it performs some
manipulation
> and continues with the next step. However, if the file does not exist, the
> next step is still invoked and fails because it needs the file. How can I
> exit a step with an error? ie. If file does not exist, then quit entire
job.
-
Re: Abort SQL Server Agent job from a step
Sounds like a job for the Windows Script host (running VBScript) and the SQL
Server DMO (data management object model). Look for those technologies on
Microsoft site.
"Shaun Higgins" <shiggins@businesspartners.co.za> wrote:
>
>I have an SQL Server Agent Job that consists of 5 steps. The first step
checks
>to see if a file exists on disk. If it does, then it performs some manipulation
>and continues with the next step. However, if the file does not exist, the
>next step is still invoked and fails because it needs the file. How can
I
>exit a step with an error? ie. If file does not exist, then quit entire
job.
-
Re: Abort SQL Server Agent job from a step
I've been developing a similar Job. The way i've structure it is:
-make an ActiveX script which checks for the existance of the file
-if the file exists, then execute a DTS package to import the file, finished
the job 'Successfully'
-if the file does not exist, then finish the job 'Successfully'
In my case, if the file does not exist, then it's not an error, I simply
check the next day...
"Shaun Higgins" <shiggins@businesspartners.co.za> wrote:
>
>I have an SQL Server Agent Job that consists of 5 steps. The first step
checks
>to see if a file exists on disk. If it does, then it performs some manipulation
>and continues with the next step. However, if the file does not exist, the
>next step is still invoked and fails because it needs the file. How can
I
>exit a step with an error? ie. If file does not exist, then quit entire
job.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks