Multiple statements in SSIS Execute SQL Task -


in ssis package have execute sql task 2 statements. basically, are:

insert table2 select * table1; truncate table table1 

first statement failed (duplicate records). table1 empty now! misunderstand basic principles of databases?! expected whole batch fail if first statement failed.

in execution report there expected error messages: 1. cannot insert duplicate key row. 2. statement has been terminated. possible failure reasons bla-bla

my server sql server 2012 sp2 cu1, oledb connection

there no other truncate statements table known me. have gone insane?

you need trap error ..

insert table2 select * table1; if @@error = 0     truncate table table1 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

jquery - Keeping Kendo Datepicker in min/max range -