How to import pipe delimited text file data to SQLServer table

前端 未结 2 1506
既然无缘
既然无缘 2021-01-13 01:01

I have database table represented as text file in the following pattern:

0|ALGERIA|0| haggle. carefully f|
1|ARGENTINA|1|al foxes promise|
2|BRAZIL|1|y along         


        
2条回答
  •  抹茶落季
    2021-01-13 01:16

    If you have a large amount of data you can use bcp to bulk import from file: http://msdn.microsoft.com/en-us/library/ms162802.aspx

    The bcp utility bulk copies data between an instance of Microsoft SQL Server and a data file in a user-specified format. The bcp utility can be used to import large numbers of new rows into SQL Server tables... Except when used with the queryout option, the utility requires no knowledge of Transact-SQL. To import data into a table, you must either use a format file created for that table or understand the structure of the table and the types of data that are valid for its columns.

提交回复
热议问题