SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS parameterized package problem


SSIS parameterized package problem

Author
Message
tebalsamo
tebalsamo
Grasshopper
Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)

Group: General Forum Members
Points: 24 Visits: 198
Hi, I'm hoping to get help with a problem I've been struggling with for several months. I have inherited a set of ssis packages. I need to modify one of these packages. The existing package has a control flow which houses an execute SQL Task step that goes out to the database and pulls back a value for the date(s) the package needs to execute for. The scope of the variables is set to the package level. This step then connects to a sequence container that houses a data flow task. My problem lies in the first step of the data flow. I have an ADO Net Source component that uses a SQL Command which needs the variable values to get a set of data between a start date and end date. The variables are set up in the package as shown in the attachment (and below), and I need specifically to use FromDate and ToDate parameters:
---
Name Scope Data Type Value

FromDate LoadDW Datetime 5/9/2013 12:09 PM

PrevDate LoadDW Datetime 4/30/2013 1:11 PM

RecordCount LoadDW Int32 0

RowCount LoadDW Int32 0

ToDate LoadDW DateTime 5/9/2013 12:09 PM
--
When I open the sql command in the ADO Net Source component of the data flow step I need to modify, the section that uses the FromDate and ToDate paramenters looks like this:
....and j.INVOICEDATE between cast
('5/9/2013 12:09:00 PM' as date) and cast(' 5/9/2013 12:09:00 PM' as date)

When I try to replace these data values with question marks such as ....and j.INVOICEDATE between cast (? as date) and cast( ?as date)......
then click ok I get an incorrect syntax near ? error message.

When I try to insert the names, such as: ....and j.INVOICEDATE between cast(FromDate as date) and cast(ToDate as date).....
I get an error message saying incorrect column name 'FromDate', Invalid column name 'ToDate'

If I leave the values alone, then I only get back the data that has an invoice date of 5/9/2013 regardless of what the value of variables that have been passed to it is.

I've read all types of posts on this, and everything I've read seems to point to the use of the ? to point to a variable. Is there something different that needs to be done when using the ADO Net source as opposed to an OLE DB Source?

Please help!
Attachments
SSIS Error.docx (14 views, 117.00 KB)
tebalsamo
tebalsamo
Grasshopper
Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)

Group: General Forum Members
Points: 24 Visits: 198
No one has any insight on this?
Phil Parkin
Phil Parkin
SSCoach
SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)

Group: General Forum Members
Points: 19231 Visits: 20461
Out of interest, can you briefly explain why you are using ADO rather than OLE DB?


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
tebalsamo
tebalsamo
Grasshopper
Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)

Group: General Forum Members
Points: 24 Visits: 198
No, as I mentioned, I inherited the packages and am an SSIS newbie. I'm just trying to add some functionality to an existing package that I am now doing manually.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search