[dba-SQLServer] DTS Conditional email

Richard Lavsa rlavsa at tigg.com
Mon Oct 2 08:12:54 CDT 2006


Ron,

Thanks for the idea.  
I got hung up last week with another issue but wanted to let you know I
it working this morning.. =).. 

Rich 

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Ron
Allen
Sent: Thursday, September 28, 2006 4:16 PM
To: dba-sqlserver at databaseadvisors.com
Subject: Re: [dba-SQLServer] DTS Conditional email

I have to do something similar. In my case, I store the number of rows
returned in a global variable, then I use an ActiveX script in DTS to
branch execution based on the value. Here is the JavaScript I use:

function Main()
{
	if (DTSGlobalVariables("RecordCount").value == 0)
	{
		return(DTSTaskExecResult_Failure);
	}
	else
	{
		return(DTSTaskExecResult_Success);
	}
}

Then I just branch on failure to the steps needed for that, and on
success to the rest of the DTS package that runs normally.

HTH,

Ron



> Hello all,
> 
> I was able to build a workflow very quickly to run a query, get the 
> results, export them into an excel file, then email the file to a 
> distribution list.
> 
> I am stuck on how to make it do this only when the query returns rows.
> The reason for this to be conditional, is that this only happens when 
> a process does not complete of which then needs to throw a flag to 
> certain people to check into the issue.
> 
> Any help would be greatly appreciated.
> 
> Rich
> CONFIDENTIALITY NOTICE: The information contained in this transmission

> may be confidential or privileged, and is intended solely for the 
> entity or individual to whom it is addressed. If you are not the 
> intended recipient, please be advised that any use, copying, 
> disclosure, dissemination or distribution is strictly prohibited. If 
> you received this transmission in error, please contact the sender at 
> TIGG Corporation immediately by replying to this email and deleting it
from your computer.
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
> 
_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com
CONFIDENTIALITY NOTICE: The information contained in this transmission may be confidential or privileged, and is intended solely for the entity or individual to whom it is addressed. If you are not the intended recipient, please be advised that any use, copying, disclosure, dissemination or distribution is strictly prohibited. If you received this transmission in error, please contact the sender at TIGG Corporation immediately by replying to this email and deleting it from your computer.



More information about the dba-SQLServer mailing list