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.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Defined Variables not loaded in send mail task

Author  Topic 

raky
Aged Yak Warrior

767 Posts

Posted - 2010-03-08 : 02:07:38
Hi,

I created one ssis package. The objective of the package is to send the result of a query as an email.

The Control Flow Items iam using in the package are
1) Execute SQL Task
2) Send Mail Task

In Execute SQL Task, i am using the following query

select count(*) as RecCnt from tbl

and i set result type to single row and defined a variable with name RecCnt with data type as Int32.

In Send Mail Task, I configured SMTP Server with credentials.
When i goes to mail page in Send Mail Task Editor , iam not getting loaded Message Source dropdown with the variable RecCnt which i created earlier even after selecting Message Source Type = Variable.

How i can get RecCnt varialbe in Message Source dropdown ?

Even if managed to do it...Package ends with an error saying as below

[Send Mail Task] Error: Variable "User::RecCnt" is not of type string.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-03-08 : 11:36:05
you need to map the variable to message source property of send mail task in dynamic properties tab

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -