locked
Execute SQL Task failed. RRS feed

  • Question

  • When I execute package , I meet  these errors.

    Error: 0xC001F009 at Package: The type of the value (DBNull) being assigned to variable "User::Variable" differs from the current variable type (String). Variables may not change type during execution. Variable types are strict, except for variables of type Object.

    Error: 0xC002F210 at Execute SQL Task, Execute SQL Task: Executing the query "select * from books;" failed with the following error: "The type of the value (DBNull) being assigned to variable "User::Variable" differs from the current variable type (String). Variables may not change type during execution. Variable types are strict, except for variables of type Object.

    ". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

    Friday, December 20, 2019 4:32 AM

Answers

  • Hi Chenlong2019,

    May I know if the ResultSet is Full result set in your Execute SQL Task?

    If so, please change the data type of variable "User::Variable" from String to Object.

    Using the Execute SQL task to return a full result set is similar to returning a single-row result set. The primary differences are that your target variable must be configured with the Object data type, and the task’s ResultSet property must be set to Full result set.

    Please refer to the following links:

      Execute SQL Task

      SSIS Basics: Using the Execute SQL Task to Generate Result Sets

    Best Regards,

    Mona



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Friday, December 20, 2019 5:49 AM

All replies

  • Hi Chenlong2019,

    May I know if the ResultSet is Full result set in your Execute SQL Task?

    If so, please change the data type of variable "User::Variable" from String to Object.

    Using the Execute SQL task to return a full result set is similar to returning a single-row result set. The primary differences are that your target variable must be configured with the Object data type, and the task’s ResultSet property must be set to Full result set.

    Please refer to the following links:

      Execute SQL Task

      SSIS Basics: Using the Execute SQL Task to Generate Result Sets

    Best Regards,

    Mona



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Friday, December 20, 2019 5:49 AM
  • Thanks,Mona.
    Friday, December 20, 2019 8:45 AM