March 1, 2010 at 4:24 am
Hi
I need to truncate multiple tables on a nightly basis ready for new data import.
Could someone please advise the best way of achieving?
Kind Regards
March 1, 2010 at 5:27 am
You could write a stored procedure and call that sproc from within your SSIS package. You could simply add that step the an existing package, like the one that you are using to perform the import.
Pretty simple really.
Andrew SQLDBA
March 1, 2010 at 9:36 am
I agree with the stored procedure, but I am not sure why you have to bother with placing the call in an SSIS package. You can just call it from a job. Also, if the truncation schedule fluctuates by table name and/or day/time then you can store the values of the table and date/time in a table that the stored procedure reads and acts on.
Regards,
Toby
March 1, 2010 at 9:39 am
Thanks Guys.
Created a stored procedure which is called from a batch file using SQLCMD as currently this is a development machine with SQL Express installed so no SQL Agent feature.
March 1, 2010 at 9:41 am
Never a good idea to use old fashioned, non-secure batch files. That is just awful. How are you calling other stored procedures? I suggest that you use something other than Express.
Andrew SQLDBA
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply