April 8, 2009 at 11:51 am
I currently have 2 dts packages that are used to send output to various Excel spreadsheets.
In the first package the data is inputted into the excel spreadsheets by creating a table in a sql task. A transformation data task then uses data from a query as a data source and sends the data into a destination table (created in the sql task) and then outputs the data into Excel. this process is repeated 7 times as the several query data that are required to be put into excel.
In the second package starts of with a sql task that updates a source table then calls the 1st package. It does this 15 times. When I execute the package after initially updating the table I get an error saying that it failed because all the tables already exist. These being the tables that are created in the sql task in the first package. How can I modify the package so that everytime I run it I table is recreated instead of just remaining there?
I have attached some screen shots of the package as my explanation may not be clear.
I am running the packages as legacy code in sql 2005. I am not sure if that will affect the performance. Any ideas would be much appreciated.
May 7, 2009 at 7:36 am
Hello,
This can be easily done in a few ways.
One way is to begin your second package with a sql task that does a if exists to check for the existence of the table. If the table exists, then drop it and recreate.
Another way that this can be done is to begin your second package with some ActiveX code that checks for the existence of the table, drops it and then recreates.
A few other ways is to end your first package with one of the above mentioned steps to drop the table (either through a SQL task or ActiveX code).
Hope that helps.
Tony
Things will work out. Get back up, change some parameters and recode.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply