0

i need to make a bulk insert from vb to sql, i have two ways : SqlBulkCopy and pass table as parameter to the stored procedure , but i'm facing a timeout exception with these two methods for huge data.. is there any other way to prevent a for loop from vb to sql and to prevent a timeout and cpu usage on sql.

User7291
  • 1,095
  • 3
  • 29
  • 71
  • 2
    Only SqlBulkCopy actually does bulk insert. The stored procedure would do this only if you used the `BULK INSERT` statement - which only reads files. It's equivalent to the `bcp` command line utility. As for the timeout- what timeout? Command or connection? If it's command, just increase it. Check this [duplicate](http://stackoverflow.com/questions/4535536/timeout-expired-with-sqlbulkcopy) question – Panagiotis Kanavos Feb 11 '15 at 15:47
  • Also, depending on your timeouts, you could try inserting a smaller chuck of data at a time. – SoulTrain Feb 11 '15 at 15:53

0 Answers0