views:

222

answers:

2

I want to truncate a table before doing a SqlBulkCopy. Does SqlBulkCopy automatically truncate a table before copying the data?

+2  A: 

No, not to my knowledge.

I don't see any options on the SqlBulkCopy class that would allow you to instruct SqlBulkCopy to truncate before loading.

You'll have to do that yourself before launching SqlBulkCopy.

marc_s
A: 

Is it possible to truncate the table from ado .net? Or do you need to call a stored proc to do that?

Prabhu
Yes, it's possible, presuming you have the appropriate rights.
Adrien