![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I created execute sql task with the below insert statement. Insert into properties(PROPERTYID) select propcode from htcrepr where propcode not in (select propertyid from properties) group by propcode And I also created sql Mail task , the workflow is success. the problem is the workflow is always success if I execute the sql task and sends mail . my question is how do we send a mail only if the rows are inserted in to a table. -- Message posted via http://www.sqlmonster.com |
#3
| |||
| |||
|
|
You could set the row count to a global variable and then call an ActiveX script that fails if the count is zero, causing a workflow branch to not send an email. Jim "chinna jambu via SQLMonster.com" <forum (AT) SQLMonster (DOT) com> wrote in message news:e17966f387cb4f359bbb8de1d8f8be56 (AT) SQLMonster (DOT) com... I created execute sql task with the below insert statement. Insert into properties(PROPERTYID) select propcode from htcrepr where propcode not in (select propertyid from properties) group by propcode And I also created sql Mail task , the workflow is success. the problem is the workflow is always success if I execute the sql task and sends mail . my question is how do we send a mail only if the rows are inserted in to a table. -- Message posted via http://www.sqlmonster.com |
#4
| |||
| |||
|
|
Wouldn't it be simpler to just add some extra T-SQLon to the end- IF @@ROWCOUNT = 0 OR @@ERROR <> 0 RAISERROR('All gone wrong.', 16, 1) -- Darren Green http://www.sqldts.com http://www.sqlis.com "Jim Young" <thorium48 (AT) hotmail (DOT) com> wrote in message news:e3EX31JGFHA.1528 (AT) TK2MSFTNGP09 (DOT) phx.gbl... You could set the row count to a global variable and then call an ActiveX script that fails if the count is zero, causing a workflow branch to not send an email. Jim "chinna jambu via SQLMonster.com" <forum (AT) SQLMonster (DOT) com> wrote in message news:e17966f387cb4f359bbb8de1d8f8be56 (AT) SQLMonster (DOT) com... I created execute sql task with the below insert statement. Insert into properties(PROPERTYID) select propcode from htcrepr where propcode not in (select propertyid from properties) group by propcode And I also created sql Mail task , the workflow is success. the problem is the workflow is always success if I execute the sql task and sends mail . my question is how do we send a mail only if the rows are inserted in to a table. -- Message posted via http://www.sqlmonster.com |
![]() |
| Thread Tools | |
| Display Modes | |
| |