Solved

SSIS script task

Posted on 2008-10-08
5
331 Views
Last Modified: 2013-11-10
I need to copy file  and add today's date to the file copied.. I added this code to script task in SSIS and it wasnts me to do Dim oFso as ..help..can someone check the code below

Dim oFSO            
Dim sSourceFile
Dim sDestinationFile
 
Set oFSO = CreateObject("Scripting.FileSystemObject")
sSourceFile = "c:\Customer\Customerinfo.xls"
sDestinationFile = "c:\Customer\CustomerInfo& (cstr(month(date)) & "-" & cstr(day(date)) & "-" & cstr(year(date))) & ".xls"
 
oFSO.copyFile sSourceFile, sDestinationFile
 
Set oFso = Nothing
 
0
Comment
Question by:ohemaa
[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
  • 3
  • 2
5 Comments
 
LVL 60

Expert Comment

by:chapmandew
ID: 22671973
You don't need to use FSO.  instead, import System.IO into your script, then use the following code to modify the files name:

System.IO.File.

it should pop up a list of methods available to use.
0
 

Author Comment

by:ohemaa
ID: 22672327
how do I do that pls? I am new to this stuff
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 22672424
open the script task, go to design script, and at the very top, add this:

Imports System.IO
0
 

Author Comment

by:ohemaa
ID: 22673153
can you explain.. if I do not use fso.  what do i use to copy the file from source to destination? like this
oFSO.copyFile sSourceFile, sDestinationFile
0
 
LVL 60

Accepted Solution

by:
chapmandew earned 500 total points
ID: 22673173
you can do this:

 System.IO.File.Copy(sSourcePath, newName, True)
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

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.
I have a large data set and a SSIS package. How can I load this file in multi threading?
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
Via a live example, show how to shrink a transaction log file down to a reasonable size.

733 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