Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Error reading a csv (already open in Excel) using SSIS Expand / Collapse
Author
Message
Posted Wednesday, February 20, 2013 1:53 AM


Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, August 7, 2013 9:20 PM
Points: 13, Visits: 80
hi,
I'm loading data into a table from a csv file using a data flow task.

If the file is already open by a user in Excel the SSIS is not able to read and instead throws out the message "The process cannot access the file because it is being used by another process"

This never happens if the csv is open in a notepad.

Is it possible that even if the file is pen in excel the SSIS can still read.Please remeber that SSIS just need to read the data and doesn't care about any unsaved data in the file.
Post #1421980
Posted Wednesday, February 20, 2013 7:25 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, August 7, 2014 1:31 PM
Points: 1,431, Visits: 3,226
push another copy of the file over for SSIS to use.... or push another copy over for users to look at.




The probability of survival is inversely proportional to the angle of arrival.
Post #1422079
Posted Wednesday, February 20, 2013 10:24 PM


Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, August 7, 2013 9:20 PM
Points: 13, Visits: 80
thanks , I'm sure this soultion would work , howeevr i was still interested to know whether it is possible to use the same file in 'Read Only' mode just as we do in in windows.
Post #1422399
Posted Thursday, February 21, 2013 6:14 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: 2 days ago @ 5:26 AM
Points: 119, Visits: 483
Hi,

just an idea. Maybe is an indirect way, but what about to use a Script Component or a Script Task and use C# to proccess the csv file. There is a method to open a file in Read mode in the System.IO.File. There are also several code snippets in the Web to read csv files with C# like here.

The problem with the flat file source is you cannot configure to many parameters, therefore you do not have too many options with it.

Hope this helps.

Kind Regards.


Paul Hernández
http://hernandezpaul.wordpress.com/
https://twitter.com/paul_eng
Post #1422529
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse