November 4, 2011 at 6:34 pm
A lot of these problems can be resolved by importing into a staging table using BULK INSERT with OPTION (MAXDOP 1) set. You shouldn't import directly to a final table, anyway. Import to a staging table (usually a Temp Table) and do what should always be done... validate the data before sending it to its final resting place.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 4, 2011 at 8:57 pm
Jeff Moden (11/4/2011)
A lot of these problems can be resolved by importing into a staging table using BULK INSERT with OPTION (MAXDOP 1) set. You shouldn't import directly to a final table, anyway. Import to a staging table (usually a Temp Table) and do what should always be done... validate the data before sending it to its final resting place.
With no response from the OP for quite awhile, I'm wondering if we really know what the problem is. My guess, at this point, is that he/she did a SELECT ... with no ORDER BY and assumed order of insertion. We still don't know how the OP determined that it was not inserting in the desired order 🙂
Jared
Jared
CE - Microsoft
November 16, 2011 at 8:15 am
opc.three (11/4/2011)
ulisseslourenco (11/1/2011)
Hi guysThere is an application in my company which imports files inside several tables on database. However when there are simultaneous files, a lot of them import registers out of order.
i guess there is some configuration to avoid importing files wrong order in bcp.
How import a file exactly the original file in bcp?
best regards.
You can do it by setting batch size to 1. Use the -b option for bcp.exe. Use the BATCHSIZE option for BULK INSERT. Here is a thread that describes the issue in detail:
Thanks dude,
I will see that link.
Viewing 3 posts - 16 through 17 (of 17 total)
You must be logged in to reply to this topic. Login to reply