从CSV Excel上传1400万条记录到SQL Server 2019的最佳方式[已关闭]

7kqas0il  于 2022-12-10  发布在  SQL Server
关注(0)|答案(1)|浏览(135)

Closed. This question does not meet Stack Overflow guidelines . It is not currently accepting answers.

This question does not appear to be about programming within the scope defined in the help center .
Closed 10 days ago.
Improve this question
Is there any best way to upload 14 million records into SQL Server database, without splitting the file.
Thanks in advance.

  • I have tried with import export wizard tool, but the database freezes.
  • I am expecting an alternate source to upload the 14 million records to SQL Server.
jmo0nnb3

jmo0nnb31#

The fastest way is using the Bulk Insert. You can insert the data into table or Common table expression CTE or table variable or temp table then I'd remove the duplicate rows across the distinct and Joins command from t-sql.

BULK INSERT TableName
FROM 'C:\SomeDirectory\my table.csv'
WITH
(
    FIELDTERMINATOR = '\t',
    ROWTERMINATOR = '\n'
)
GO

And here is the full parameter description.

相关问题