2

I have a file I want to import into an SQL Server 2019 database running on Ubuntu 20.04. The file resides in the /proc directory and I have done a chmod 777 on that file. However, when trying to read it from a SQL Server query using Openrowset, I get this error:

select * from openrowset(bulk '/proc/loadavg', SINGLE_CLOB) cpu_load

Msg 12703, Level 16, State 1, Line 1

Referenced external data source "(null)" not found.

If I copy that file to the /var/opt/mssql directory, it will then work and I can query the file. Why can I not read a file in /proc but I can from /var/opt/mssql? Also, how do I get access to the /proc file from within SQL Server?

0

1 Answer 1

3

From here:

the /proc directory is NOT a real File System, in the sense of the term. It is a Virtual File System. Contained within the procfs are information about processes and other system information. It is mapped to /proc and mounted at boot time.

Save or copy the file in virtually any other folder, and provide permissions to access it, and you should have no problem.

1
  • 1
    I ended up adding a cron job that copies the file to the /var/opt/mssql and then it works. May 19 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.