How to truncate three tables before inserting the records into destination tables in SSIS

Posted by vspsantu-21529 under Sql Server on 4/5/2013 | Points: 10 | Views : 1724 | Status : [Member] | Replies : 1
How to truncate three tables before inserting the records into destination tables in SSIS

I added Exceute SQL Task aNd hook to the Dataflow task.
I double-clicked on Exceute SQL Task and wrote the below line.

SELECT 'TRUNCATE TABLE ' + tblproduct1 + tblcustomert1 + tblcustomert1

After debug the pakage, i am getting below errors

1. Error: Incorrect syntax near ','.

2.

[Execute SQL Task] Error: Executing the query "TRUNCATE TABLE tblproduct,
TRUNCATE TABLE tblcust..." failed with the following error: "Incorrect syntax near ','.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

3. Task Execute SQL Task failed

And i am importing excel data into three destination tables.

Actually without Exceute SQL Task control run succfully. Butt actual excel rows are 10224. If run so many times, records adding into table like 10224 * 5.

So, if run many times records should should be show 10224 in table.

So, now i need to truncate the destination tables before importing the records from excel to three destination tables.

Santhosh P


Responses

Posted by: Jayakumars on: 4/5/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
http://irfansworld.wordpress.com/2011/07/31/how-to-truncate-and-load-a-table-from-ssis/

Mark as Answer if its helpful to you

vspsantu-21529, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response