all groups > sql server dts > october 2006 >
You're in the

sql server dts

group:

Importing Empty FIle


Re: Importing Empty FIle Norman Kelm
10/25/2006 12:00:00 AM
sql server dts: 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 at http://www.gerasus.com/

[quoted text, click to view]
Importing Empty FIle Phil
10/25/2006 1:14:01 AM
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.

Re: Importing Empty FIle weelin
10/25/2006 5:54:44 AM
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


[quoted text, click to view]
AddThis Social Bookmark Button