Discussion:
Scripting Task
(too old to reply)
The Other Mike
2010-05-14 18:14:44 UTC
Permalink
I am very new to SSIS 2005

I have a sql command Select count(*) from table_a. The result is stored in
a global variable. In a script task, if the record count is 0 then I want
the flow to go to a task where it sends me an email of "no records found".
If there are records, then I want to execute a data flow into an excel
spreadsheet. I had it working in sql 2000, but now I don't know how to
program it. Could someone help.

Thanks
Mike
Todd C
2010-05-18 12:45:01 UTC
Permalink
First of all, I wouldn't use a Script task. A regurlar Execut SQL task would
probably work as well (unless you need complex manipulation of the connection
string or command)

Anyway, create your two Control Flow objects and connect the 1st task, be it
your Script or Execute SQL to each of those. Right click on one of the green
connecting arrows and select Edit. Choose "Expression and Constraint" for the
first option. For the Value, leave it at "Success" and in the Expression,
enter the following:

@<My Variable Name> == 0
or
@<My Variable Name> > 0
as appropriate.

Hope this helps.
--
Todd C
MCTS SQL Server 2005
Please mark posts as Answered when appropriate.
Post by The Other Mike
I am very new to SSIS 2005
I have a sql command Select count(*) from table_a. The result is stored in
a global variable. In a script task, if the record count is 0 then I want
the flow to go to a task where it sends me an email of "no records found".
If there are records, then I want to execute a data flow into an excel
spreadsheet. I had it working in sql 2000, but now I don't know how to
program it. Could someone help.
Thanks
Mike
.
Loading...