Kishh
Kishh

Reputation: 2065

how to truncate the data before insert using DTS

I have source server and destination server, i have insert the data from source to destination, but before that i have to delete the records if any in destination - (DTS)

Upvotes: 0

Views: 775

Answers (2)

Code_Tech
Code_Tech

Reputation: 795

If you want to remove whole existing table than create sql task and write :

drop table (tablename)

If you want to remove only data inside existing table than create sql task and write :

truncate table (tablename)

Upvotes: 1

Jagmag
Jagmag

Reputation: 10366

Create an Execute SQL task in the correct sequence of your package and call the following code to delete the rows

TRUNCATE TABLE tablename

Refer MSDN link for more details

Upvotes: 0

Related Questions