all groups > sql server dts > july 2006 >
You're in the

sql server dts

group:

Conditional paths within ActiveX script


Conditional paths within ActiveX script nirmalp NO[at]SPAM digitalwavefront.com
7/20/2006 4:33:01 PM
sql server dts:
Okay, so here's my issue. I have an execute SQL task which queries a DB
for the # of orders to be processed (select count(*) as nOrders from
ORDERS) for any given day. Then, I have a script task, that takes this
# and (if > 0) does everything else (process the orders, creates xml
file, pgp encrypts it, and then transfers it via FTP to the fulfilment
vendor).

My problem is that when the # of orders are 0 I want to send a simple
email to a group of people notifying them of the fact that there were
no orders. And here's where I can't seem to get it to work. Any
suggestions? Here's what I have (short version) immediately following
the execute SQL task.

Function Main()
set rsOrderCount = DTSGlobalVariables("o_rsOrderCount").Value

nOrders = rsOrderCount("nOrders")

if nOrders > 0 then
Main = DTSTaskExecResult_Success ''' take next steps....process
order file, generate xml, pgp encrypt and ftp tasks follow
else
''' EMAIL: NO ORDERS TO PROCESS GOES HERE (this is yet another
ActiveX script
end if
End Function

Help!!!!!!!!

Thanks.
DW
Re: Conditional paths within ActiveX script Allan Mitchell
7/24/2006 2:55:09 PM
Hello nirmalp@digitalwavefront.com,

So you have two "On Success" constraints coming from your script task that
tests the variable value. You simply enable or disable the attached step
based on what action you want to take. We do a very similar thing here


Looping, Importing and Archiving
(http://www.sqldts.com/default.aspx?246)



Allan Mitchell
www.SQLDTS.com
www.SQLIS.com
www.Konesans.com

[quoted text, click to view]

AddThis Social Bookmark Button