Solved

Dynamic Filename In SQL Server 2000 DTS Package FTP Task

Posted on 2007-03-20
6
2,817 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

757 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

23 Experts available now in Live!

Get 1:1 Help Now