Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

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

$
0
0

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.

I


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>