dbTalk Databases Forums  

Failure constraint for execute SQL task

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


Discuss Failure constraint for execute SQL task in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Matt D
 
Posts: n/a

Default Failure constraint for execute SQL task - 04-11-2006 , 05:40 PM






When executing a sql task, how do you get the failure constraint to be
tripped? I want an email to be sent when a sql script is not
successfully executed, but the package just seems to end and never
executes the send mail task. I've tried using RAISERROR() but that
doesn't seem to work either. When the task successfully executes the
success constraint works perfectly fine. Thanks for any help.


Reply With Quote
  #2  
Old   
Matt D
 
Posts: n/a

Default Re: Failure constraint for execute SQL task - 04-11-2006 , 06:49 PM






Just to be clear this is using SSIS in SQL Server 2005.


Reply With Quote
  #3  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Failure constraint for execute SQL task - 04-11-2006 , 07:25 PM



Hello Matt,

It works for me. For the SQL Statement I entered RAISERROR('This is an Error',16,1).

Is this package Vanilla?


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

Quote:
When executing a sql task, how do you get the failure constraint to be
tripped? I want an email to be sent when a sql script is not
successfully executed, but the package just seems to end and never
executes the send mail task. I've tried using RAISERROR() but that
doesn't seem to work either. When the task successfully executes the
success constraint works perfectly fine. Thanks for any help.




Reply With Quote
  #4  
Old   
Matt D
 
Posts: n/a

Default Re: Failure constraint for execute SQL task - 04-12-2006 , 01:44 PM



Hi Allan,
Thanks for the response. As an experiment I ended up recreating it with
a new SQL task and now it seems to work. I also had a data flow task
that wasn't properly tripping the error constraint either and after I
recreated it, that seems to work properly now too. The only thing I can
think of is that I used the import/export wizard to originally create
the package then modified it from there rather than originally creating
it within VS.NET. Other than that, I have no idea what the problem was
as I cut and pasted everything exactly as it was before.


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.