Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
ahouse
Starting Member
27 Posts |
Posted - 2010-01-13 : 14:38:32
|
Hi all,I'm not sure if I'm going about this the wrong way but I'm having trouble setting a user defined variable in my SSIS package. I see how to set a variable to a SQL function such as GetDate() or to hardcode it with text etc...but I need my variable to be set from a SQL select statement.The TO variable within an SSIS email function depends on a clientid that I have. So my variable needs to be something like:Select emailaddress from Clients where ClientID = max(clientid)I can't figure out where I can set this at. If I do Set @@User_Email or whatever the variable is called, it does not recognize it.Any ideas?Andrew |
|
svicky9
Posting Yak Master
232 Posts |
Posted - 2010-01-17 : 04:27:23
|
HiDo the followinga. Create a Execute SQL taskb. Create a variablec. Set the resultset to single row if you are sending a single rowd. Populate the SQL statemente. go to resultset tab and type in 0 under Resultname and variablename under variablef. connect the result set to the send email task g. Go to expressions tab and set the Toline to the variableLet me know if it worksThanksVivekhttp://www.sqlserver007.com |
|
|
|
|
|