Error - The type of the value (DBNull) being assigned to variable differs from current variable type

  • Hi,

    I am getting the following error on Execute SQL Task which I have placed just before the ADO Foreach loop container.

    "The type of the value (DBNull) being assigned to variable "User::ADO_FILENAME" 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.

    The query I have used in the Execute SQL task is  - select distinct src_file_name from  TEMP_SALES_DIA_ORD_REV.

    I have used '0' as the Result Name and 'User::ADO_FILENAME' as the Variable name in the Result Set and the ResultSet type is 'Full Result Set'.

    Does somebody please have any ideas on how to rectify this error. ? Thanks.

  • If your variable (ADO_FILENAME) is of type String, you cannot assign a record set (which is what you get when you choose ResultSet type "Full Result Set") to it. You'll have to either change the variable to type Object so it can be assigned to a record set, or change the ResultSet property.

  • Martin Schoombee - Thursday, November 15, 2018 5:59 AM

    If your variable (ADO_FILENAME) is of type String, you cannot assign a record set (which is what you get when you choose ResultSet type "Full Result Set") to it. You'll have to either change the variable to type Object so it can be assigned to a record set, or change the ResultSet property.

    Thanks a lot, it worked when I changed the datatype to Object !

Viewing 3 posts - 1 through 2 (of 2 total)

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