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
Post a Comment