Search code examples
sql-serverimport-from-excelssms-2014

Error while trying to create table in MSSQL using flat-file import


I am trying to import a .csv file to SQL Server Native 11.0 in order to create a table.

However, I am getting the following error:

  • Warning 0x80070020: Data Flow Task 1: The process cannot access the file because it is bein gused by another process.
  • Error 0xc020200e: Data Flow Task 1: Cannot open the datafile

enter image description here enter image description here

Following the the .csv data:

enter image description here

Need help in figuring out the solution for these errors.


Solution

  • Issue: This was happening because I have opened the .csv file in excel and at the same time I was trying to import it to SQL Server.

    Solution: Try closing the file before importing. It should work then, as it worked for me.