If I have an empty table with an index and I do a bcp, does SQL Server (internally) drop/disable the index, load the data and then re-apply/enable/build the index?
No, the indexes are maintained throughout the operation. In fact, Microsoft says you can improve bcp performance by using the -h ORDER
hint to sort the data according to your clustered index. See the bcp Utility documentation for details. However, as stated here, for the fastest import possible you should take the following steps:
· The "select into/bulkcopy" database option must be set to "true".
· The target table should not have any indexes. [emphasis added]
· The target table must not be published for replication.
· Use the TABLOCK to lock the target table.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With