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.


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

    This link solved my problem

    😀

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

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