Solved

Dynamic Filename In SQL Server 2000 DTS Package FTP Task

Posted on 2007-03-20
6
2,820 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

863 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now