dbTalk Databases Forums  

Inserting rows in to a table

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


Discuss Inserting rows in to a table in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
chinna jambu via SQLMonster.com
 
Posts: n/a

Default Inserting rows in to a table - 02-21-2005 , 10:17 PM






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

Reply With Quote
  #2  
Old   
Jim Young
 
Posts: n/a

Default Re: Inserting rows in to a table - 02-21-2005 , 11:15 PM






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

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



Reply With Quote
  #3  
Old   
Darren Green
 
Posts: n/a

Default Re: Inserting rows in to a table - 02-22-2005 , 09:16 AM



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

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





Reply With Quote
  #4  
Old   
Jim Young
 
Posts: n/a

Default Re: Inserting rows in to a table - 02-22-2005 , 09:45 AM



Yes, that would work also. I often make make things more complicated than
they need to be!

Jim

"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote

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







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.