Link to home
Start Free TrialLog in
Avatar of EdZeppelin
EdZeppelin

asked on

How to script a Package in SSIS using an Excel Source and Data Reader Dest

Greetings,
Could someone assist in writing a script a Package in SSIS (ie the "Script Task") to have an Excel Source control point to an Excel file and DataReader Destination or OLE DB Destination control append the Excel file's data into a SQL Server table.  I'm a newbie at SSIS ; any help or good links appreciated.
Avatar of Reza Rad
Reza Rad
Flag of New Zealand image

I hope you ask your further question in SSIS Zone!

But for the answer now:
why you want to script it?
you can use data flow task in SSIS with excel source and any destination you want.
what you want to do exactly?  what is your problem?
SOLUTION
Avatar of ValentinoV
ValentinoV
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of EdZeppelin
EdZeppelin

ASKER

I was looking for the place to specify SSIS zone and didn't see it.  I'll look for it again when posting next question.  
I need the script because I'll want to pass in a file path and file name as a variable for the Excel file.  The path and file name will be specified by an end user in an ASPX web page and passed to the SSIS package where the Excel Source control will incorporate this dynamic info.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I think I'm real close.  I right clicked on Excel Connection Manager and opened up the Property Expression Builder and selected ConnectionString under property on the left side and I tried to specify a user variable XLConnStr for the right side Expression but all variations kicked out errors.  Does someone know the right syntax for the Expressions dialog box, I looked in the two books on SSIS and they were that helpful.

Is a dtsDataParameter in vb.net the same as a package variable in SSIS; the code in the apx side is working, just have to get package and variable set right.

Thanks for all your help & links.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm setting the variable to data type to "string".  I've been unable to specify a User variable when creating a new variable, even after typing in "User::"  so when I try to use it in the Expression window it would kick out an error saying it was unable to find the variable I created.  The scope is set to Data Flow Task and was trying to change it to package level scope but haven't yet found the spot to change it.  Is that an easy fix?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I clicked the ellipsis at the right of the Expression Builder and the variable I created was not visible/accessible.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I was able to change the scope of the variable to package and then set it in the Excel Conn Manager and set the Expression \ ExcelFilePath to the User variable but then the following error showed up.  I'll do some 'Net searching  on error msg #'s etc. but has someone ran into this one below?


Error at SSISExcelTest [Connection manager "Excel Connection Manager"]: SSIS Error Code DTS_E_OLEDBERROR.  
An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available.  Source: "Microsoft JET Database Engine"  Hresult: 0x80004005  Description: "Invalid argument.".

Error at Data Flow Task [Excel Source [1]]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  
The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009.  
There may be error messages posted before this with more information on why the AcquireConnection method call failed.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If my own comment was considered part of the solution; it was an accident and should be changed.  Apologies.