How to just clear a table before importing data?

Why is it so difficult to figure out how to clear data from a table before importing? Can someone point me in the right direction for the standard best practice procedure for this in SSIS 2012? I used basic SQL statements; i.e. delete the table name, TRUNCATE tablename, etc.

+4
source share
3 answers

I would use Execute SQL Task for this. Put your shortened or remove from statement in the SQLStatement property. In addition, as Lamark stated, you can make sure that the "Result Set" property is set to none, since you have problems with errors returned due to the result binding.

+6
source

Due to best practice, I usually follow the practice of doing as much SQL as you can. The Execute SQL Task, as @jymbo advises, is probably the best course of action, even if there were a truncator inside SSIS itself.

0
source

@Paynetech - Sorry this question was asked, as this seemingly simple task threw me away when I tried to create my own SSIS project. And since I should post this as an answer, since I cannot comment on the original question, here is some additional reading information that helped me: http://social.msdn.microsoft.com/forums/sqlserver/en-US/ d69f2598-3f95-41f1-bd86-da46e9b6d18b / want-to-delete-records-from-table-using-ssis

By the way, when searching google for "ssis how to remove" - ​​this question is # 2, # 1 - how to remove the SSIS package itself.

0
source

Source: https://habr.com/ru/post/1490718/


All Articles