c# - Importing large text file into sql database -
i read txt files , saving rows file local database.the problem program reads 700 000 rows , takes long time read whole file. use linq sql, firs read row, split in table object , submit db.
for example row has format
2014-03-01 00:08:02.380 00000000000001100111 this row splited datetime , 20 columns (each column represents 1 channel (ch1 - ch20))
is there better (faster) way?
you can use filehelpers http://filehelpers.sourceforge.net/ feed directly sqlbulkcopy. http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx far easiest , fastest approach.
you can still use linq-2-sql read/non-batch writes bulkinsert is slow.
Comments
Post a Comment