|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Wednesday, March 20, 2013 5:33 AM
Points: 44,
Visits: 62
|
|
Dear All,
Hi! I need to generate Insert scripts of more than 1 million records & execute the same on another server. The normal frequency is weekly but, but sometimes I have to run it twice / thrice in a week.
I need to know that how we do make batch of these insert statements so that instead of executing individual statements we can execute group of Insert statements. The batch/group can be of 2000 rows or 5000 rows to improve the performance.
I also need to know that will it increase the performance as we are inserting multiple records in a single batch?
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 4:49 AM
Points: 1,075,
Visits: 5,119
|
|
You can try BCP. It has options to inset rows in batches.
BCP is known to be faster than other methods.
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Saturday, April 06, 2013 9:18 AM
Points: 57,
Visits: 76
|
|
| I would suggest to create and run the ssis package for loading the data to another server.If that is the requirement.
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 9:31 AM
Points: 65,
Visits: 443
|
|
Last I knew BCP is incompatible with FULL RECOVERY MODE and I don't fly without a parachute.
We got a huge performance increase by sending a large "multi-row" XML string into a stored procedure, parsing it into a table variable and inserting the rows in one shot. It is messy but fast and you get to keep your reliable backups.
|
|
|
|