none
Linked Server from Linux Docker 2017/2019 to SQL Server 2005 ?? RRS feed

  • Question

  • Howdy all

    Is this supported?

    I tried a bunch of ideas but the closest I get is the following error:
    "[S0001][10054] TCP Provider: An existing connection was forcibly closed by the remote host."

    -------

    EXEC sp_addlinkedserver @server = N'abc123', @srvproduct = N'', @provider=N'SQLNCLI', @datasrc = N'abc123.assoc.com,1433'
    EXEC sp_addlinkedsrvlogin @rmtsrvname=N'abc123', @useself=N'FALSE', @locallogin=NULL, @rmtuser=N'user', @rmtpassword=N'xxxxxx';

    -------

    FROM:
    Docker Image:
    Docker Hub
    mcr.microsoft.com mssql server:2017-latest
    mcr.microsoft.com mssql server:2019-latest



    TO:
    Windows Server 2003 R2
    SQL Server Microsoft SQL Server 2005 - 9.00.4340.00 (X64)

    -------

    Any ideas are welcome.

    Thanks in advance.


    Thursday, January 23, 2020 9:51 PM

All replies

  • Have you checked which port the SQL 2005 instance is actually listening to? You can see this in the beginning of the errorlog.

    Speaking of the errorlog, is there anything interesting in the errorlog (on the SQL 2005 machine)?

    The setup of the linked server looks good. (Provided that the port number is the right one). This is more likely to be a networking issue, like a firewall being in the way.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    Thursday, January 23, 2020 10:14 PM
  • Hi __soccer__, 

    Thank you for your issue. 

    Sorry that I am not familiar with Docker . Also , SQL Server 2005 have be out of support . Please update your SQL Server version first . https://www.microsoft.com/en-us/sql-server/sql-server-downloads

    Best Regards,

    Rachel 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, January 24, 2020 3:15 AM
  • Hi,

    Thanks for the responses.  Unfortunately, upgrading the SQL Server in the near future in not an option.  I would love nothing more.

    The port is correct.  I used WireShark on the SQL Server 2005 machine and can see the traffic coming in and routed to the running SQL Server 2005 instance.

    I checked the errorlog and see nothing at all related this traffic.  Listening on 1433 and 5022.  I have since tried both, same error message.

    I can connect via the same linked server configuration from a different SQL Server 2008 instance.

    I suspect a compatibility issue at play here.  I'm suspicious of the difference in providers used when I compare the successful link from 2008 (SQLNCLI10) with the unsuccessful link from 2019 (SQLNCLI11) when using the default @provider=N'SQLNCLI'.

    I would also like to add that linked servers work perfectly fine from Docker 2019 to the same SQL Server 2008 instance reference above.

    Any other leads I can chase down?

    Thanks again for your time.



    Friday, January 24, 2020 2:42 PM
  • The current version of SQL Server Native client does not support connecting to SQL 2005.

    Please see:

    https://docs.microsoft.com/en-us/sql/relational-databases/native-client/applications/support-policies-for-sql-server-native-client?view=sql-server-ver15


    Friday, January 24, 2020 2:51 PM
  • That would explain it.

    Any work-arounds?

    Friday, January 24, 2020 3:22 PM
  • SQL 2005 was "end of life" on 4/12/2016.

    The upgrade from 2005 to 2014 is fairly painless.  There are very few breaking changes from 2005 to 2014.  Except for non-ansi outer joins *= and =*.


    Friday, January 24, 2020 3:51 PM
  • The current version of SQL Server Native client does not support connecting to SQL 2005.

    Of course. There is nothing that supports SQL 2005 these days.

    But "not supported" is not the same as "will not connect". I was able to set up a linked server from an SQL 2019 instance with SQLNCLI11 to my SQL 2005 instance. (Whereas this is bound to fail it the remote instance is SQL 2000.)

    Also, since _soccer_ has set up login-mapping, this cannot be an issue with connectivity to the AD or something like that.

    I really need to get started with Docker, but I am not there yet, so I don't know much about that part, but I don't see why that would have something to do with it. A faint possibility is that Docker speaks TCP/IP in a way that old dusty Windows 2003 R2 does not understand. Then again, I cannot connect from SQL 2019 on Windows 10 to an SQL 2005 instance on Windows 2000.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    Friday, January 24, 2020 10:21 PM