sqlbulkcopy imports only 17837 out of 67000 rows

iis sqlbulkcopy

Question

The sqlbulkcopy function works fine in my local environment but when I deploy it to IIS it only imports 17837 out of the 67K odd rows. Does anybody know what can cause this issue?

Accepted Answer

Actually the problem was with the Excel connection string I was missing the 'IMEX=1' at the very end. The correct connection string is - Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\uploaded.xlsx;Extended Properties='Excel 12.0 Xml;HDR=YES;IMEX=1'"



Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why