1 Replies - 423 Views - Last Post: 07 August 2013 - 07:43 AM Rate Topic: -----

#1 twins2me  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 65
  • Joined: 30-July 13

Importing a file into my MS SQL database

Posted 06 August 2013 - 07:38 PM

I am trying to import information that I have read and separated into rows using VB.NET code in my application. The problem is that I now have over 800 rows of data that need to be inserted into a table. I don't have control of the type of file (they use .tff) or how the data file is setup, or I would set it up to import easily. I can't import it directly using the import wizard in SQL server. My application has the user use the openfiledialog in VB to select the file they want, then it reads the file (I can get it to read the .tff file and pull out the important data - thanks to other users on this site), and then imports the data (this is where I'm stuck).

This is a combination of programming and database issue. I want to know if there is an easy way to import the data to my database. I can write code to import each line individually, but that would take forever and slow the application by processing code for 800 rows of data.

I have attached a text version of my file for reference.

Thank you in advance!

Attached File(s)



Is This A Good Question/Topic? 0
  • +

Replies To: Importing a file into my MS SQL database

#2 rgfirefly24  Icon User is offline

  • D.I.C Lover
  • member icon


Reputation: 267
  • View blog
  • Posts: 1,477
  • Joined: 07-April 08

Re: Importing a file into my MS SQL database

Posted 07 August 2013 - 07:43 AM

you could turn the data into an XML Document and send the entire XML document into the database at once. This would negate the need for multiple calls, but you would still have a slow down while the query runs. Really your only option is if you want the application not to seem to suspend is to use threading and do the inserts inside a worker thread while the main application still runs.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1