Solved

creating a file and then copying it: how to break the dependency between the 2 steps in SSIS

Posted on 2011-03-07
4
327 Views
Last Modified: 2013-11-10
Oledb source editor pumps data into a flat file destination editor. after this data flow task, there is a file system task editor that copies this file into another OS drive location. This step is failing saying "The process cannot access the File ... because it is being used by another process."

how can we make sure that the first data task does not keep a hold on the file so that the next step does not fail? Is this plausible?

thanks
0
Comment
Question by:anushahanna
  • 2
4 Comments
 
LVL 30

Accepted Solution

by:
Reza Rad earned 250 total points
ID: 35065760
you can fill data into file with SCRIPT COMPONENT AS DESTINATION.
then in the script component PostExecute method you can Flush and Close the streamwriter.

and you will never have problem on other tasks after this step.

for working with files in script component, you need to use System.IO.StreamWriter.
you should instanciate a new streamwriter at PreExecute method of script component
and fill values in flat file with streamWriter.WriteLine() in the ProcessInputRow

and finally close the stream writer in PostExecute method with
streamwriter.Flush();
streamwriter.Close();
0
 
LVL 6

Author Comment

by:anushahanna
ID: 35069694
thanks for the alternative idea-

the idea i have mentioned above - do you anticipate this issue always? i did not seem to happen in SSIS 2005, but SSIS 2008 is perhaps more picky?
0
 
LVL 16

Assisted Solution

by:vdr1620
vdr1620 earned 250 total points
ID: 35071302
Well, i use SSIS 2008 to do similar tasks, i also use Excel file in may situations but never saw this problem with csv or Txt files...

I would say if you are unable to resolve the issue.. try to run these tasks manually one by one and see if the problem still persists..iF yes then there is Something wrong

Also, i believe this is more of a permissions issue on the Folder and not with SSIS. make sure that the user has Read write Permissions to the folder
0
 
LVL 6

Author Comment

by:anushahanna
ID: 35141589
worked well - thanks.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

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 …
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
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.

929 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

9 Experts available now in Live!

Get 1:1 Help Now