SQL Server Performance

Populating DateTime variable from Execute SQL task

Discussion in 'SQL Server 2005 Integration Services' started by ubear, Sep 27, 2006.

  1. ubear New Member

    Please help!

    I am designing an SSIS package and need to change the value of a DateTime global variable with the value returned from an Execute SQL task. The queary is as follows:



    Select Versiondate = dateadd(dd,+1,Max(CreateDate)) from msdb..sysdtspackages p with(nolock)
    where name = '@name'



    The error message is as follows:

    SSIS package "Package.dtsx" starting.

    Error: 0xC002F210 at VersionDate_Set, Execute SQL Task: Executing the query "Select Versiondate = dateadd(dd,+1,Max(CreateDate)) from msdb..sysdtspackages p with(nolock)

    where name = '@name'" failed with the following error: "The type of the value being assigned to variable "User::VersionDate" differs from the current variable type. 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.

    Task failed: VersionDate_Set

    SSIS package "Package.dtsx" finished: Success.

    The variable is set to data type DateTime, but the value will not change. Any ideas?
  2. satya Moderator

Share This Page