Monday, March 26, 2012

Opening password protected Excel files

I have a stored procedure in which I am importing data from a password protected Excel file to a SQL table. The file comes from our client and the password cannot be removed before sending, per his company policy.

I would like to create a DTS package to open the file and import the data. Is there a way to pass the password to the DTS package?

Thanks!May refer to this KBA (http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q211378).|||I can do this if I am using Excel, but I need to do it from a stored procedure. Is this possible using TSQL?

Thanks!|||Honestly I never tried, you may search under SQL DTS (http://www.sqldts.com) for further information.|||I got it!!! One of my coworkers (who was out when I needed the answer yesterday) had the solution!

dtsrun /Sservername /Uuid /Ppwd /Npackagename /AFileName:8= excelfilename /APassword:8=excelpwd

:-)|||Good keep it up, your reply help others.

No comments:

Post a Comment