dbTalk Databases Forums  

DTS Package Script Help

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss DTS Package Script Help in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Cindy
 
Posts: n/a

Default DTS Package Script Help - 08-19-2003 , 11:35 AM






I have a DTS package that loads text files. One of the
file created by mainframe (Security.dat) sometimes has 0
bytes in it.

While executing DTS Package, I need to check if the
Security.dat file is 0 bytes. If it is, I need to leave
the Security (Table that the data goes into)table alone.
If it is not 0 bytes (meaning some data is in it), I need
to delete the current data in the Security table and load
the new data from Security.dat file.

Can anyone send me a script (or any other way) to do this ?

Thanks for any help.

Reply With Quote
  #2  
Old   
J O Holloway
 
Posts: n/a

Default Re: DTS Package Script Help - 08-19-2003 , 11:49 AM






You could use an ActiveX task at the start of the process, and use vbScript
to determine the length of the file, and then in that vbScript delete it if
it's not zero length.


"Cindy" <cmorrison (AT) hotmail (DOT) com> wrote

Quote:
I have a DTS package that loads text files. One of the
file created by mainframe (Security.dat) sometimes has 0
bytes in it.

While executing DTS Package, I need to check if the
Security.dat file is 0 bytes. If it is, I need to leave
the Security (Table that the data goes into)table alone.
If it is not 0 bytes (meaning some data is in it), I need
to delete the current data in the Security table and load
the new data from Security.dat file.

Can anyone send me a script (or any other way) to do this ?

Thanks for any help.



Reply With Quote
  #3  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: DTS Package Script Help - 08-19-2003 , 12:40 PM



Use an Active Script task.

Check the size of the file using the FileSystemObject

http://www.aspfaqs.com/ASPscripts/Pr....asp?FAQID=125

--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



"Cindy" <cmorrison (AT) hotmail (DOT) com> wrote

Quote:
I have a DTS package that loads text files. One of the
file created by mainframe (Security.dat) sometimes has 0
bytes in it.

While executing DTS Package, I need to check if the
Security.dat file is 0 bytes. If it is, I need to leave
the Security (Table that the data goes into)table alone.
If it is not 0 bytes (meaning some data is in it), I need
to delete the current data in the Security table and load
the new data from Security.dat file.

Can anyone send me a script (or any other way) to do this ?

Thanks for any help.



Reply With Quote
  #4  
Old   
Darren Green
 
Posts: n/a

Default Re: DTS Package Script Help - 08-19-2003 , 01:16 PM



In article <098f01c36673$1f540ca0$a001280a (AT) phx (DOT) gbl>, Cindy
<cmorrison (AT) hotmail (DOT) com> writes
Quote:
Is there a way you could send me an example ?

Thanks again....
Some examples including file sizes and deleting files here -

Working with files and the FileSystemObject
http://www.sqldts.com/default.aspx?6,101,292,0,1
--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.