I just wanted to know that SQL Statement INSERT INTO TABLE1 SELECT * FROM TABLE2
, will work same like bulk insert ?
If no, Is there any way exclude index while inserting records. Process is inserting 150 Millions data in one execution.
We are planning to create stage table (Which will not have any index Table1
), then transfer it from stage table to target table (Which will have index Table2
)
We are not in the situation to create flat file from the process.
But we are looking something that can speed up process when we transfer data from Table1
(not indexed) to Table2
(indexed).
Any way to use BulkInsert
from Table1
to Table2
?
Best Answer
Your best bet will be to use SSIS or BULK INSERT. There are various performance improvements that you can do when using them and they are very well documented in The Data Loading Performance Guide.
At SSIS level, you can look into below things to speed up data read and data load :
Refer to Speeding Up SSIS Bulk Inserts into SQL Server for more details.
Below are some good ways to improve BULK INSERT operations :
The max degree of parallelism should be configured on the server rather than the default. You can refer to my answer on how it configure it here.
If you are using SQL Server 2014 then
SELECT ... INTO
is parallel.Also, you should monitor Wait Statistics on the server especially SOS_SCHEDULER_YIELD resulting in scheduler contention on Servers having multiple CPUs running concurrent Bulk load operations and competing for the same CPU Cycles.
Also refer to :