Changing the package variable value when executed through Stored Procedure

  • Hi all,

    I am executing one package through a Stored Procedure. Changing the value of a package variable. The SP is getting executed properly, but the variable value is not getting changed.

    ALTER PROCEDURE [dbo].[sp_PkgExec]

    AS

    BEGIN

    DECLARE @returncode int

    EXEC @returncode = xp_cmdshell 'DTExec /FILE "pkg.dtsx"

    /set \Package.Variables[User::strFilePath].Properties[Value];"file1.csv"'

    print 'Return Code ' + CAST(@returncode As Varchar(10))

    END

    It is returning Return code as "zero" i.e. the package is getting executed with no error, still not applying the new value for variable "strFilePath".

    Please help.

    Thanks in advance.

  • Hi all,

    I was forgot to map the variables in package.The problem is solved.

    Thanks.

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

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