0

I installed and configured SQL Server 2017 on Ubuntu 16.04, with developer license. The installation works fine, I can connect to it with Management Studio as well, and restore databases from .bak files.

But I can't find any solution, or alternative to use Ole Automation Procedures.

The enable commands

sp_configure 'show advanced options', 1;  
GO  
RECONFIGURE;  
GO  
sp_configure 'Ole Automation Procedures', 1;  
GO  
RECONFIGURE;  
GO  

returns this response:

Configuration option 'show advanced options' changed from 1 to 1. Run the RECONFIGURE statement to install.
Configuration option 'Ole Automation Procedures' changed from 1 to 1. Run the RECONFIGURE statement to install.

But when I try to use sp_oacreate

EXEC @ret=sp_OACreate 'MSXML2.ServerXMLHTTP', @objectID OUT

I got 0 as @ret value, which means its OK, but also got error message on output:

Could not load the DLL odsole70.dll, or one of the DLLs it references. Reason: 2(The system cannot find the file specified.).

Can someone suggest some workaround, or config tip please?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
NemoPeti
  • 79
  • 1
  • 7
  • OLE is microsoft technologie and wont run standard on linux. You will have to search if you can get OLE working through wine. – GuidoG Feb 20 '19 at 07:45
  • I don't need the OLE itself, just the thing can do with sp_oa methods. Especially HTTP requests (POST,GET,SOAP) propably I can make an assembly that use C# code, or CURL, but becouse of the mixed servers (Windows and Unix), the database update would be a pain. – NemoPeti Feb 20 '19 at 09:12
  • @NemoPeti, sp_OACreate is reliant on OLE which means it's pretty likely that it just won't work on SQL Server for Linux because the OLE infrastructure doesn't exist. It's surprising that there's no explicit documentation to say as much, but after a quick search I can't find any. You may also struggle to use a CLR if you need to use `EXTERNAL_ACCESS` or `UNSAFE` (which I needed when I last did HTTP from SQL, on Windows) assemblies as the release notes for 2017 state that these aren't supported: https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-release-notes?view=sql-server-2017 – Rob Feb 20 '19 at 09:28
  • @NemoPeti, SQLCLR is your only option and, IMHO, a better solution than using COM objects in T-SQL. That being said, http requests belong in app code rather than T-SQL. – Dan Guzman Feb 20 '19 at 11:47
  • Thanks @Rob and Dan Guzman I also thinking on CLR, to keep compatibility with both windows and unix servers, but it nedds a lot of work on the existing codebase... I also don't understnad why there arnt a single lint in the sql for unix spec, that witch function not avaible on the version. – NemoPeti Feb 20 '19 at 15:25

0 Answers0