Re: Importing Empty FIle



Norman is right, I had to do something similar with zip files, though I
was checking that there were more than 4 rows by size.

You can use the File System Object to point to the file, then check the
size.
Something like this

filename="c:\test\test.txt"

Set fso = CreateObject("Scripting.FileSystemObject")

set mainfile=fso.GetFile(filename)

IF mainfile.Size > 50 Then -- this is in bytes
-- Do something
ELSE
-- Do something else
END IF


regards

Weelin


On Oct 25, 11:57 am, Norman Kelm <nor...@xxxxxxxxxxxxxxxxxxx> wrote:
Hi Phil,

Perhaps you could write an ActiveX script task that opens the error file
and counts the number of rows. Then have success and failure constraints
that point to the correct action. Success run the transform.

Norman

get DTS Package Search athttp://www.gerasus.com/



Phil wrote:
Hi,

I wonder if there is a work around for the following problem, I have a DTS
pack that imports a number of uploaded files as well as files that show
errors that we have had in the files that we have uploaded. The DTS works
fine when there are errors listed in the Error file but wont work when the
file is empty, you get the error

"Error creating datafile mapping: The volume for a file has been externally
altered so that the opened file is no longer valis."

I know that really this makes sense, but I could do with the DTS not failing
at this point, any ideas, what I would like if for it to do is complete the
DTS and just have an empty table where the files should be imported into.

Thanks PD- Hide quoted text -- Show quoted text -

.



Relevant Pages

  • Re: Importing Empty FIle
    ... Then have success and failure constraints that point to the correct action. ... I wonder if there is a work around for the following problem, I have a DTS pack that imports a number of uploaded files as well as files that show errors that we have had in the files that we have uploaded. ... I know that really this makes sense, but I could do with the DTS not failing at this point, any ideas, what I would like if for it to do is complete the DTS and just have an empty table where the files should be imported into. ...
    (microsoft.public.sqlserver.dts)
  • Re: DTS bug (?): Data Driven Query Task incorrectly replaces empty strings with NULL.
    ... DataPump task works as expected so it is not something that DTS cannot ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) ... >> Allan Mitchell MCSE,MCDBA, ...
    (microsoft.public.sqlserver.dts)
  • Re: DTS bug (?): Data Driven Query Task incorrectly replaces empty strings with NULL.
    ... DataPump task works as expected so it is not something that DTS cannot ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) ... >> Allan Mitchell MCSE,MCDBA, ...
    (microsoft.public.sqlserver.server)
  • Re: DTS Import of a text file only importing about 1/2 of the file
    ... Certainly the row counts are not over overflowing DTS's capacity. ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) ... www.SQLDTS.com - The site for all your DTS needs. ... >I have a DTS import that imports a text file into a sql server table. ...
    (microsoft.public.sqlserver.dts)
  • Re: Bypass step when source file empty
    ... DTS doesn't like 0-byte files, so the simplest way to do this I've found ... HTH ... > Hello Quentin, ... The source file can sometimes be empty. ...
    (microsoft.public.sqlserver.dts)