Re: Bypass step when source file empty

From: Darren Green (darren.green_at_reply-to-newsgroup-sqldts.com)
Date: 05/18/04


Date: Tue, 18 May 2004 22:34:07 +0100

In message <uitQD$BPEHA.2920@tk2msftngp13.phx.gbl>, Quentin Ran
<ab@who.com> writes
>Hi group,
>
>I have a DTS package where one of the step is to load a flat file into a sql
>table. The source file can sometimes be empty. How can I avoid an error
>state from this step FOR ONLY THIS (other failure should still be observed)
>and continue executing the following steps that have work flow dependency on
>this step, when this file comes in empty?
>
>Advise/sample code greatly appreciated.
>
>Quentin
>
>

Try the following articles, but instead of checking if the file exists,
you can check the file size, through the FileSystemObject as per one of
the other posts.

How can I check if a file exists?
(http://www.sqldts.com/default.aspx?211)

Skip the execution of an individual Task
(http://www.sqldts.com/default.aspx?214)

-- 
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com
PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org


Relevant Pages

  • Re: xp_cmdshell and dtsrun
    ... The Sql Server Service account and Server ... Agent Service account are both the same... ... I'm not having a problem executing the the DTS Package, ...
    (microsoft.public.sqlserver.programming)
  • Re: Access while running DTS package using stored procedure
    ... Note that our SQL server is automatically started when the Win 2003 server ... > The permissions when executing xp_cmdshell can be different depending on who ... >> I wrote a DTS Package that can take the data from a .txt file residing ...
    (microsoft.public.sqlserver.dts)
  • Re: Validation prior to inserting data
    ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. ... > I created a DTS package that downloads a text file from an ftp site,> deletes the existing data in the sql table, and then inserts the new ... The package works but I have run into> instances where the source text file has invalid data - duplicate> primary keys. ... When this happens the data doesn't get loaded and I end> up with an empty table. ...
    (microsoft.public.sqlserver.dts)
  • Re: Problem Executing DTS Task from VB
    ... execution of a DTS package? ... if I'm just interested in executing an existing package without ... SQL-DMO) that I can utilize from VB to instruct SQL Server to fire the ...
    (microsoft.public.sqlserver.dts)
  • DTS and VB
    ... I tried executing a DTS package I have installed locally on a SQL Server ... runs within my workstation instead of executing on the server. ...
    (microsoft.public.sqlserver.dts)