Global Variable: Execute SQL Task

Last Post 22 Mar 2007 11:35 AM by GoodFella3993. 1 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
GoodFella3993
New Member
New Member

--
22 Mar 2007 10:02 AM
Is there anyway to declare a Global Variable in a DTS package and then call it within an Execute SQL Task.

I want to make a Global Variable a string containing a list of email addresses. Then, in the Execute SQL Task, I want to use this Global Variable as the input to the @recipients of the xp_sendmail stored procedure.

Right now i just have the variable set with in the Execute SQL Task.


Set @EmailTO = N'me@me.com'

EXEC master.dbo.xp_sendmail
@recipients=@EmailTo

----

i want it like this:

EXEC master.dbo.xp_sendmail
@recipients=@GlobalVariable

Thank You,
Marc
GoodFella3993
New Member
New Member

--
22 Mar 2007 11:35 AM
Im getting a syntax error


Acceptable Use Policy
---