Home > Back-end >  Transfer Tab Tab delimited Txt documents to the database
Transfer Tab Tab delimited Txt documents to the database

Time:03-23

Xe10.3.3
Essentially a 20082 or Sqllite
Dividing a TXT documents TAB tabs 90 listed 350000 rows set rapid database
How do you achieve?



CodePudding user response:

Using MSSQL import tool to go, do not need to write code,
https://jingyan.baidu.com/article/d5a880ebc0d5d413f047cc76.html

CodePudding user response:

If you want to own programming import, can consult https://blog.csdn.net/BlueStorm/article/details/82807591
BCP is the fastest way of import, there is no one

CodePudding user response:

Need to make programming import I use the
 

Bulk insert Tbabc from 'E: \ 123456. TXT - from c: \ MZTC TXT import
With (FIELDTERMINATOR='\ t'
ROWTERMINATOR='\ r \ n')


Always prompt

 
Message 4866, level 16, state 1, line 1
Large capacity load, failure data files in line 1 92th column is too long, please verify whether it is right to specify the field terminator and line terminators,
Message 7399, level 16, state 1, line 1
Link to the server "(null)" OLE DB access interface "BULK" error, the provider did not give any information about the error,
Message 7330, level 16, state 2, line 1
Can't from the link server "(null)" OLE DB access interface "BULK" line extraction,

CodePudding user response:

Bulk insert Tbabc from 'E: \ 123456. TXT' with datafiletype='char'

Note that E: \ 123456. TXT refers to the Sql server on E packing list 123456. TXT file,

If the TXT file on the client side, with BCP. Exe import:
BCP. Exe dbname.. Tablename in E: \ 123456. TXT - Sserverip - Uusername - Ppassword - t

CodePudding user response:

Due to the TAB 'character is used as the separator, so the value of the field cannot contain a TAB character, otherwise unable to normal import
  • Related