Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to Use package variable in Execute SQL task Expand / Collapse
Author
Message
Posted Tuesday, November 2, 2010 8:21 AM


UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Tuesday, November 29, 2016 7:47 AM
Points: 1,434, Visits: 980
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 @Env WHEN 'Dev' THEN '\\Dev\'
WHEN 'Test' THEN '\\Test\'
WHEN 'UAT' THEN '\\UAT\'
WHEN 'PrdSRV' THEN '\\PrdSRV\'
ELSE '\\share\' END,
@ToMail=CASE @Env WHEN '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
Post #1014534
Posted Tuesday, November 2, 2010 8:34 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 8:25 PM
Points: 7,960, Visits: 19,065
To use SSIS variables within the Execute SQL task, use an Expression to set the appropriate property of the task.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.

If your posting includes some T-SQL code, please surround the code with IFCode formatting tags. It helps readability a lot.
Post #1014554
Posted Tuesday, November 2, 2010 10:47 AM


UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Tuesday, November 29, 2016 7:47 AM
Points: 1,434, Visits: 980
http://blogs.techrepublic.com.com/datacenter/?p=237

This link solved my problem
Post #1014678
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse