I have created ssis package to loda data from excel to database. My problem is Those excel files proteced with password( I know the password) at the minute i am removing password mannually. Is there any way to automate in ssis, Because i have 200 excel files.
相关问题
- Excel sunburst chart: Some labels missing
- SQL to Parse a Key-Value String
- Error handling only works once
- Excel formula in VBA code
- How to evaluate an input in the WHERE clause
相关文章
- Code for inserting data into SQL Server database u
- SQL Server 2008 Change Data Capture, who made the
- Get column data by Column name and sheet name
- SSIS solution on GIT?
- programmatically excel cells to be auto fit width
- How do we alias a Sql Server instance name used in
- Unregister a XLL in Excel (VBA)
- How to prevent excel from truncating numbers in a
Vinnies answer gave me another idea - what if you would use an apdater like excel file.
Opening protected-files with excel (vba) is easy, and then, you could import your files all to this workbook or create copies of them, that are unprotected or you might even copy the data directly into ssis/sql-server.
However, this would be my suggestion. Use excel to create a new source of your input-data, then use whatever to import this new data.
According to MSDN, "You cannot connect to a password-protected Excel file."
http://msdn.microsoft.com/en-us/library/ms139836(v=sql.105).aspx
There may be a way to access it through custom script where you read out what's in the excel sheet to a csv to be processed. Or maybe into an object. But, I haven't found anything to help yet.
Here is a forum post from SQL Server Central that might help. It has a powershell script sample (login required)
http://www.sqlservercentral.com/Forums/Topic885800-148-1.aspx
No matter what, I think you're going to have to get the data out of the protected excel sheet before you can process it.
UPDATE: CozyRoc sells a connection manager that will let you use password protected excel sheets as connections.
http://www.cozyroc.com/ssis/excel-connection
This may or may not work based on your company's security policy (or monitoring thereof), but you could write a quick macro that opens all 200 files and saves them in a temp "unprotected" directory without a password. Then run your SSIS script, and when that completes, delete all 200 files (with a secure deleter such as Eraser)