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: Monday, September 12, 2016 11:45 PM
Points: 1,434, Visits: 973
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: Today @ 3:04 PM
Points: 7,542, Visits: 18,269
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.

The Dunning-Kruger Effect: the metacognitive inability of those of low ability to recognize their ineptitude and evaluate their ability accurately.
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: Monday, September 12, 2016 11:45 PM
Points: 1,434, Visits: 973
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