DTS load empty file

  • I have a simple DTS package that loads a text file to a table.  The package is executed by a nightly, scheduled job.  Sometimes the input file is empty which causes the job to report a failure.  I'd like the job to report success whether the input file is empty or not.  Is there a way to do that?  Thanks

  • You could write a sql script to check that the size of the file is greater than 0, if not, don't execute the dts.  The script would need to create a temp table, then insert into the temp table by shelling out to command prompt (xp_cmdshell) and do a dir command for the file.  You would then parse out the file size from that.

    Steve 

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply