dbTalk Databases Forums  

Scripting Task

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Scripting Task in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
The Other Mike
 
Posts: n/a

Default Scripting Task - 05-14-2010 , 01:14 PM






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

Reply With Quote
  #2  
Old   
Todd C
 
Posts: n/a

Default RE: Scripting Task - 05-18-2010 , 07:45 AM






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.

"The Other Mike" wrote:

Quote:
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

.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.