Link to home
Start Free TrialLog in
Avatar of bsumanrao
bsumanrao

asked on

Truncate & Insert tasks in SSIS

I dont understand, how this tasks need to be done in SSIS.

The table is created in the database. I setup a connection to database. i had weekly running ssis package in which, data is moving from SQL to Excel File.  I had a couple of tasks in control flow:
Execute process task, in which executable command file is present. Here last 5 copies of data is stored.
DataFlow Task: Used for moving data from SQL to Excel Sheet.

Now i need to insert couple of commands in this package.
Truncating the table in a database (truncate command)& Inserting fresh data into the table(Insert Command), so that this fresh data moves into excel sheet

Can u please help me out with the above tasks.
Avatar of Steve Hogg
Steve Hogg
Flag of United States of America image

To Truncate the data in the table you will use an Execute SQL Task.
Inserting Fresh Data can be done by either an Execute SQL Task or Data Flow Task, the choice is usually dependent on the source.
In the Execute SQL Task you choose a Connection Manager, the same database connection used in the Destination of the mentioned Data Flow task. You set the SQL Source to Direct Input and the SQL Statement to:
TRUNCATE TABLE  Owner.YourTableName
Avatar of bsumanrao
bsumanrao

ASKER

Where i need to insert the Execute SQL Task...

I mean is it between Process task & Data Flow Task in Control Flow tab.... Please give information Clearly..........
ASKER CERTIFIED SOLUTION
Avatar of Steve Hogg
Steve Hogg
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
A