When the amount of text data is relatively large, the input of a strip is basically impossible, and writing a program to relay it is also very troublesome, fortunately SQL Server provides a relatively concise method.
Bulk Insert table name from ' C + + your text file. txt ' with (fieldterminator = ' What symbol to split the data ', rowterminator= ' with what symbol plus \ n End ') --\n is the meaning of a carriage return, is the carriage return front is what symbol, if unsigned direct single quotation mark \ n Bulk insert #temp from ' C:\test.txt ' with (FieldTerminator = ', ', rowterminator= ' \ n ')--#temp是表名 , Test.txt,fieldterminator = ', ' Each data is separated by commas, and rowterminator= ' \ n ' Each row of data ends with a carriage return.
Easily handle fixed-format text data import, which is more concise than MySQL's SQL code.
Import fixed-format txt text data to a SQL Server database