Solved

Dynamic Filename In SQL Server 2000 DTS Package FTP Task

Posted on 2007-03-20
6
2,821 Views
Last Modified: 2013-11-30
I am trying to write a SQL Server 2000 DTS package that will pull down a file using SQL Server's "FTP TASK". The catch is... the file that I am trying to pull down has a filename that is based on the date that the file was created. For example: the filename is '03012007.ZIP' on March 1st, 2007. On March 2nd, 2007, the filename will be: '03022007.ZIP', etc... I will need to write a VB Script that will dynamically create the name each day.

Question is:
What would I do to my DTS 'FTP Task' so that I can pass it the dynamic filename each day?
*I ask that you please be as specific as possible in your responses since I am so new with DTS.
0
Comment
Question by:ccptechs
6 Comments
 
LVL 8

Accepted Solution

by:
navalarya1982 earned 500 total points
ID: 18767866
Do the following.

1.Add dynamic properties task to the DTS package,
2.Add a dynamic property
   2.1 Click add and then select ftp task
   2.2 change the source file name .. set the source to SQL. SQL as this will be easier. just write a sql which can give u the file name in format desired. Sql have date and concate functions.
3. Include this dynamic properties task as one of first steps for the package.

Let me know if you understand all.

cheers!
Naval
0
 

Author Comment

by:ccptechs
ID: 18771781
Thank you navalarya1982! That worked great...
0
 

Expert Comment

by:gwiegel
ID: 22131968
When I execute the steps separately this works, but when I execute the package I get "Invalid string format for source file name".  I'm SO close, please help.  Thank you.
select 'dhl_vacdintv' + convert(varchar, getdate()-1,112) + '.xls'

Open in new window

0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 22134022
>>I'm SO close, please help. <<
That is because you are missing step 3.  Workflow needs to be added/corrected.
0
 

Expert Comment

by:gwiegel
ID: 22134398
I thought I did?  Please advise.  I appreciate this
temp.bmp
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 22134903
That seems correct.  Intead of On Complete I would use On Success, but that should not make any difference.  Truth be told I do not use the Dynamic Properties Task but rather an ActiveX Script Task with VBScript code instead of T-SQL.  But again, that should not make any difference.  The only thing I can think of is to change this:
select 'dhl_vacdintv' + convert(varchar, getdate()-1,112) + '.xls'

To the more appropriate:
select 'dhl_vacdintv' + convert(varchar(8),  getdate() - 1, 112) + '.xls'

But I am grasping at straws.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question