Sql-server – Reading CSV files located on LINUX server and updating the tables in SQL Server Database

linuxredhatsql-server-2008-r2

I was wondering how do we ingest CSV files located on a Red Hat LINUX server into SQL Server Database Table.

I know we can write a Stored Procedure/Bulk Insert to read the files that are located on the same Windows Server as SQL Server and update the database but not sure how to do it when the files are present in LINUX.

Any help would be greatly appreciated

Best Answer

I think there are at least two generic options for this kind of thing:

  • have a network share that the SQL Server host can connect to on the Linux server.
  • sync the file from Linux server to the DB host (by e.g. using a network share on the DB host, or any other way of copying files over network).

Remark: The way Windows handles mapped network drives, it might be that the login session running the DB processes would not see the drive if it was mapped by some other user account. Thus the first option is preferred (maybe also from the pov of dbas?).