SSIS: same type of the value and variable, but getting error claiming that they

  • marchello

    Old Hand

    Points: 355

    Hi, this is funny.

    I got Execute SQL Task with SQLStatement as stored procedure; also I have Result Set configured there. I created package variable of 'DBNull' data type to handle result set (and pass it into Foreach Loop Container as a next step). Testing Execute SQL Task itself and getting error 'the type of the value (DBNull) being assigned to variable differs from the current variable type (DBNull)'. Data type is equal! What the thing? Please advise.

  • Phil Parkin

    SSC Guru

    Points: 244661

    You need to use a data type of Object to handle resultsets.

    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.
    See https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help/ for details of how to post T-SQL code-related questions.

  • marchello

    Old Hand

    Points: 355

    Thanks Phil Parkin, it works fine with variable of 'Object' data type.

    I must say, error text is not intuitive at all.

  • Phil Parkin

    SSC Guru

    Points: 244661

    marchello wrote:

    Thanks Phil Parkin, it works fine with variable of 'Object' data type.

    I must say, error text is not intuitive at all.

    I'm with you on error message clarity. On Azure, I'm currently dealing with this one, so count yourself lucky!

    'SSIS Executor exit code: -529697949'

    Message Source Name = 'WorkerAgent'

    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.
    See https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help/ for details of how to post T-SQL code-related questions.

  • marchello

    Old Hand

    Points: 355

    Thanks Phil Parkin again. I'm not big fan of Microsoft products in general. Just open to work with any type of database. SSIS usage is just side effect of my current project.

Viewing 5 posts - 1 through 5 (of 5 total)

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