dbTalk Databases Forums  

Need to run all SQL Statements regardless of error

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


Discuss Need to run all SQL Statements regardless of error in the microsoft.public.sqlserver.dts forum.



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

Default Need to run all SQL Statements regardless of error - 06-18-2008 , 09:12 AM






I have 3 SQL statements in a Execute SQL task in a DTS package. See below.
There is potential for the 2nd statement to fail sometimes. When this fails I
still want to run the 3rd statement regardless. How can I do that? It seems
to quit when the 2nd statement fails not running the 3rd


declare @Datetime smalldatetime
set @DateTime = convert(varchar(25), getdate(), 120)

Insert into datetimestoptable (tablename, starttime, stoptime, Branch,
Result) Values('SomeTableName', @DateTime, Null, 'Branch6', Null)
go

Execute SomeStoredProcedure --Potential to Fail
go

exececute rInsertTimeofTableComplete @TableName = 'SomeTableName'
go

Reply With Quote
  #2  
Old   
Maninder
 
Posts: n/a

Default Re: Need to run all SQL Statements regardless of error - 06-18-2008 , 08:48 PM






change the datapump task to completion instead of success, this will
help the step to move forward, regrardless of the outcome of the
previous step....

Reply With Quote
  #3  
Old   
Maninder
 
Posts: n/a

Default Re: Need to run all SQL Statements regardless of error - 06-18-2008 , 08:48 PM



change the datapump task to completion instead of success, this will
help the step to move forward, regrardless of the outcome of the
previous step....

Reply With Quote
  #4  
Old   
Maninder
 
Posts: n/a

Default Re: Need to run all SQL Statements regardless of error - 06-18-2008 , 08:48 PM



change the datapump task to completion instead of success, this will
help the step to move forward, regrardless of the outcome of the
previous step....

Reply With Quote
  #5  
Old   
Maninder
 
Posts: n/a

Default Re: Need to run all SQL Statements regardless of error - 06-18-2008 , 08:48 PM



change the datapump task to completion instead of success, this will
help the step to move forward, regrardless of the outcome of the
previous step....

Reply With Quote
  #6  
Old   
Maninder
 
Posts: n/a

Default Re: Need to run all SQL Statements regardless of error - 06-18-2008 , 08:48 PM



change the datapump task to completion instead of success, this will
help the step to move forward, regrardless of the outcome of the
previous step....

Reply With Quote
  #7  
Old   
Maninder
 
Posts: n/a

Default Re: Need to run all SQL Statements regardless of error - 06-18-2008 , 08:48 PM



change the datapump task to completion instead of success, this will
help the step to move forward, regrardless of the outcome of the
previous step....

Reply With Quote
  #8  
Old   
Maninder
 
Posts: n/a

Default Re: Need to run all SQL Statements regardless of error - 06-18-2008 , 08:48 PM



change the datapump task to completion instead of success, this will
help the step to move forward, regrardless of the outcome of the
previous step....

Reply With Quote
  #9  
Old   
Maninder
 
Posts: n/a

Default Re: Need to run all SQL Statements regardless of error - 06-18-2008 , 08:48 PM



change the datapump task to completion instead of success, this will
help the step to move forward, regrardless of the outcome of the
previous step....

Reply With Quote
  #10  
Old   
Chris
 
Posts: n/a

Default Re: Need to run all SQL Statements regardless of error - 06-19-2008 , 06:19 AM



This doesn't apply as I want all of the sql statements in the same step to
run regardless of failures or not.

I actually figured this out on my own. I wrapped everything in Try Catch
statements is this works just fine.

-Chris


"Maninder" wrote:

Quote:
change the datapump task to completion instead of success, this will
help the step to move forward, regrardless of the outcome of the
previous step....


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.