How to Use package variable in Execute SQL task

  • hi All,

    I want to use the variable in Execute sql task.

    My script will return based on the Variable.

    DECLARE @Env VARCHAR(5)

    DECLARE @FilePath VARCHAR(500),@ToMail VARCHAR(500)

    SET @Env=SSISVAriable

    SELECT @FilePath=CASE @EnvWHEN 'Dev' THEN '\\Dev\'

    WHEN 'Test' THEN '\\Test\'

    WHEN 'UAT' THEN '\\UAT\'

    WHEN 'PrdSRV' THEN '\\PrdSRV\'

    ELSE '\\share\' END,

    @ToMail=CASE @EnvWHEN 'Dev' THEN 'abcd@xyz.com'

    WHEN 'Test' THEN 'abcd@xyz.com'

    WHEN 'UAT' THEN 'abcd@xyz.com'

    WHEN 'PrdSrv' THEN 'a2z@xyz.com;1to9@abc.com'

    ELSE 'saasd@gmail.com' END

    Exec proc_test @FilePath,@tomail

    Please give steps or any link which will helpful.

    Thanks,

    Sasidhar Pulivarthi

  • To use SSIS variables within the Execute SQL task, use an Expression to set the appropriate property of the task.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • http://blogs.techrepublic.com.com/datacenter/?p=237

    This link solved my problem

    😀

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

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