Package Variable(s) from SQL Table

  • Can you post the exact error message that you are getting when executing the package?

    And also check if the query returns any rows.

    --Ramesh


  • I have the SQL Task connected to SendMail Task

    The package does not excute, it fails and says:

    Nonfatal errors occured while saving the package

    The connection "SmtpServer=" not found.

    This error is thrown by Connections collection when the specific connection element is not found

    When I run the SQL in SQL Management Studio, I get the correct result.

    I get the SMTP server name

  • A Little Help Please (4/2/2009)


    I have the SQL Task connected to SendMail Task

    The package does not excute, it fails and says:

    Nonfatal errors occured while saving the package

    The connection "SmtpServer=" not found.

    This error is thrown by Connections collection when the specific connection element is not found

    When I run the SQL in SQL Management Studio, I get the correct result.

    I get the SMTP server name

    Can you add a break point at Send Mail Task and see the result of the package variable?

    --Ramesh


  • That does not work

    Soon as I hit the Run button the error comes put, the packages does not run at all

  • Can you add a print screen of the Send Mail Task Expression Editor?

    --Ramesh


  • This is driving me mad...:crying:

    Do I need to add anything into Parameter Mapping within SQL Task Editor?

    Image attched

  • A Little Help Please (4/2/2009)


    This is driving me mad...:crying:

    Do I need to add anything into Parameter Mapping within SQL Task Editor?

    Image attched

    Have you checked the Expression Evaluated Value? It reads "SmtpServer="SmtpServer="+@[User::SMTPConnection], this could be the problem cause.

    You don't need any parameter mappings, there are used when you're query is using parameters (i.e. ?)

    --Ramesh


  • Its like the SendMail tak is trying to run before the SQLTask has managed to pick up the variable from the SQL Table.

    Are we using the correct exspression

  • The final expression should look like "SmtpServer=xxx.xxx.xxx.xxx"

    --Ramesh


  • Ramesh,

    This process we have used we have created the variable but have we declared/save them?

  • A Little Help Please (4/2/2009)


    Ramesh,

    This process we have used we have created the variable but have we declared/save them?

    Well, let me see the package variables list print screen (Right click on control flow > Variables), make sure the scope of the variable is available...

    --Ramesh


  • I have also included the error message

  • A Little Help Please (4/2/2009)


    I have also included the error message

    Now I see what is the problem!! It was my bad that I was suggesting to set incorrect property, that's because I didn't had any coffee today and its already late here.:-D:-D

    I was intended to set the "SmtpServer" property of the SMTP Connection.

    Revised Steps

    1. Go to "Send Mail Task Mail Editor"

    2. Select "New Connection" from "SmtpConnection" property, type in the values for all the properties.

    3. Now go to "Connection Managers" > Go to properties of the newly added SMTP Connection

    4. Go to "Expressions" > Select the property "SmtpServer" and select the variable

    Now this should work, otherwise I'm out of this thread now...:hehe::hehe:

    --Ramesh


  • Nope still not working!!! Same errors!!!

    I think the Expression is incorrect:

    "SmtpServer="+@[User::SMTPConnection]

  • Looking back at your first steps:

    1. Create 1 OLEDB SQL Connection

    2. Drag 1 Execute SQL Task to Control Flow

    3. In Execute SQL Task General Properties, Set Resultset = "Single row", Select the Connection, Set SQLSourceType = "Direct Input" and SQLStatement = "SELECT AccountSMTPServer FROM tblSendMail"

    4. In Execute SQL Task Resultset Properties, Set Result Name = "0" and select the package variable to which you want the column data.

    Point number 4 the following are the settings i have selected:

    Container: Package

    Name: SMTPConnection

    Namespace: User

    Value Type: String

    Value: Left Empty

    Is this correct?

Viewing 15 posts - 16 through 30 (of 37 total)

You must be logged in to reply to this topic. Login to reply