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


SSIS Variable Expressions


SSIS Variable Expressions

Author
Message
Carol Adams
Carol Adams
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1364 Visits: 342
i have vadb15\vabiv... this is a sql instance on the vadb15 server.
Tim Mitchell
Tim Mitchell
SSCrazy Eights
SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)

Group: General Forum Members
Points: 8816 Visits: 3124
It sounds like you're covering all your bases... not sure what's going on here.

How are you setting your variable value - is it set on creation (in the Variables window on the left) or are you setting it within the flow of your program, such as a ForEach loop or similar?

Check the scope of your variable - is it set at the Package level?

Can you post the exact error message you're receiving?



Tim Mitchell, Microsoft Data Platform MVP
Data Warehouse and ETL Consultant
TimMitchell.net | @Tim_Mitchell | Tyleris.com
ETL Best Practices


Carol Adams
Carol Adams
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1364 Visits: 342
It is defined on the left side of the screen as a "Package" variable.
I have an "Execute Sql Task" that populates the variable.
My Execute SQL Task General Tab has a ResultSet of SingleRow, Connection Type OLE DB, Connection of CCXXSDDB010.ietenterprise, SQL SourceType of Direct Input,
and just to test I have a SQL Statement of "SELECT 'rePORTAL_OLD' AS databasename"

Within the Result Set properties I have RESULT NAME set to databasename and VARIABLE NAME set to User::InDatabase

Nothing under the expressions properties window.

When I do set a VALUE on the left window for the variable and disable the EXECUTE SQL TASK, the stream runs.


WHen I clear out the VALUE on the variable and enable the EXECUTE SQL TASK, before it even gets to the 2nd step which is to popup a msgbox with the database name, it aborts with the following message:

TITLE: Package Validation Error
------------------------------

Package Validation Error

------------------------------
ADDITIONAL INFORMATION:

Error at Transfer Database Task [Transfer Database Task]: A source database must be specified.

(Microsoft.DataTransformationServices.VsIntegration)

------------------------------
BUTTONS:

OK
------------------------------
Tim Mitchell
Tim Mitchell
SSCrazy Eights
SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)

Group: General Forum Members
Points: 8816 Visits: 3124
OK, that means there's something in your Execute SQL Task that is not working properly. Can you post details about that task?



Tim Mitchell, Microsoft Data Platform MVP
Data Warehouse and ETL Consultant
TimMitchell.net | @Tim_Mitchell | Tyleris.com
ETL Best Practices


Carol Adams
Carol Adams
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1364 Visits: 342
My Execute SQL Task General Tab has a ResultSet of SingleRow, Connection Type OLE DB, Connection of CCXXSDDB010.ietenterprise, SQL SourceType of Direct Input,
and just to test I have a SQL Statement of "SELECT 'rePORTAL_OLD' AS databasename"

Within the Result Set properties I have RESULT NAME set to databasename and VARIABLE NAME set to User::InDatabase

Nothing under the expressions properties window.
boyapati.ram100
boyapati.ram100
Grasshopper
Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)

Group: General Forum Members
Points: 19 Visits: 18
Below video will give clear explanation


Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (128K reputation)SSC Guru (128K reputation)SSC Guru (128K reputation)SSC Guru (128K reputation)SSC Guru (128K reputation)SSC Guru (128K reputation)SSC Guru (128K reputation)SSC Guru (128K reputation)

Group: General Forum Members
Points: 128185 Visits: 22579
Carol Adams - Wednesday, April 22, 2009 5:51 AM
It is defined on the left side of the screen as a "Package" variable.I have an "Execute Sql Task" that populates the variable.My Execute SQL Task General Tab has a ResultSet of SingleRow, Connection Type OLE DB, Connection of CCXXSDDB010.ietenterprise, SQL SourceType of Direct Input,and just to test I have a SQL Statement of "SELECT 'rePORTAL_OLD' AS databasename"Within the Result Set properties I have RESULT NAME set to databasename and VARIABLE NAME set to User::InDatabaseNothing under the expressions properties window.When I do set a VALUE on the left window for the variable and disable the EXECUTE SQL TASK, the stream runs.WHen I clear out the VALUE on the variable and enable the EXECUTE SQL TASK, before it even gets to the 2nd step which is to popup a msgbox with the database name, it aborts with the following message:TITLE: Package Validation Error------------------------------Package Validation Error------------------------------ADDITIONAL INFORMATION:Error at Transfer Database Task [Transfer Database Task]: A source database must be specified. (Microsoft.DataTransformationServices.VsIntegration)------------------------------BUTTONS:OK------------------------------

This is a validation error, not a runtime error. Notice how the error is 'Error at Transfer Database Task', which presumably uses the variable as one of its parameters.
Try leaving a default value for your variable and allowing the ExecSQL task to overwrite that value when it executes.



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.
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