Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Dynamic Filename In SQL Server 2000 DTS Package FTP Task

Posted on 2007-03-20
6
Medium Priority
?
2,844 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 8

Accepted Solution

by:
navalarya1982 earned 2000 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
Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

 
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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.

670 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