Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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 02, 2010 8:21 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Wednesday, May 08, 2013 5:30 AM
Points: 870, Visits: 522
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 02, 2010 8:34 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: 2 days ago @ 5:12 AM
Points: 4,226, Visits: 9,458
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:

http://www.sqlservercentral.com/articles/Best+Practices/61537/

If you are asking for help and your post does not contain a question, you should expect responses which do not contain any answers. Put a question mark in there somewhere - it's not rocket science.
Post #1014554
Posted Tuesday, November 02, 2010 10:47 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Wednesday, May 08, 2013 5:30 AM
Points: 870, Visits: 522
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