|
|
Question : SSIS Send Result Set of an SQL Query in Send Mail Task
|
|
|
|
Hi I have an SSIS package with an Execute SQL Task and a Send Mail Task.
Execute SQL Task: It is executing the following Query and sending the Count to a Singlerow Result SET Variable.
SELECT Count(*) AS CountColumn From (
SELECT
Distinc Tab1.ColA
,Tab1.ColB
,Tab2.ColC
,Tab2.ColD
,Tab2.COLE
FROM
dbo.TableA Tab1 WITH ( NOLOCK )
JOIN dbo.TableB Tab2 WITH ( NOLOCK )
ON Tab1.ID = TAB2.ID
WHERE Tab1.Col5 = 0) A
SEND Mail Task: Will Send a notification if the above count is >= 1.
What I want now is I want to send a notification email with the Result Set of the above query.
Is it possible to do this.
Any Help would be highly Appreciated..
Thanks in Advance
|
|
|
|
Answer : SSIS Send Result Set of an SQL Query in Send Mail Task
|
|
|
|
OK, this make difference now. it is better way to do it via attachement ( if you want to do this a simple data flow task was enough for you with flat file destination ), if you want to do it as email body, you should use expression to make your mail body, and expressions have limit of 4000 character. if you have perserverance to use it as email body you can use mere sql script for this purpose, look at this thread which discussed same problem as yours fair enough with possible ways to do: http://social.msdn.microsoft.com/Forums/en/sqlintegrationservices/thread/d6ef3738-4cac-459c-82da-a068b0bbe615
|
|
|
|
|