Remote access to named instance

  • I try to connect from a pc to a SQL Server on another pc. Both pc’s are in a workgroup. I want to connect from a Windows Forms application to a named instance on the other computer. By now I have been able to connect from one pc to SQL Server on the other with tcp:smurfin, 52782.

    I want to be able to use servername\instancename (instead of portnumber) to make a connection in a Windows Forms application.

    I’ve checked / tried te following:

    • In the properties of the instance, tab Connections, the option Allow Remote Connections is enabled

    • In Configuration Manager: TCP is enabled

    • The service SQL Server Browser is started

    • On the tab IPAddresses, in the section IPAll, there is NO portnumber for TCP Port. And TCP Dynamic Ports has the nummer 52782

    • I have created un inbound rule for port 52782 and also for 1434 (SQL Server Browser). And to be on the save side: a rule for 1433 as well.

    • Restarted the service

    If I run the following code in SQL Server, that same port number (52782) is returned:

    EXEC xp_ReadErrorLog 0, 1, N'Server is listening on', N'any', NULL, NULL, 'DESC'

    GO

    SELECT local_tcp_port

    FROM sys.dm_exec_connections

    WHERE session_id = @@SPID

    GO

    DECLARE @portNumber NVARCHAR(10)

    EXEC xp_instance_regread

    @rootkey = 'HKEY_LOCAL_MACHINE',

    @key = 'Software\Microsoft\Microsoft SQL Server\MSSQLServer\SuperSocketNetLib\Tcp\IpAll',

    @value_name = 'TcpDynamicPorts',

    @value = @portNumber OUTPUT

    SELECT [Port Number] = @portNumber

    GO

    What else can I do?

  • Have you tried creating an alias on your SQL Native Client configuration on the machine you are connecting from?

  • No, but that is not necessary for connection, is it?

  • Nope, if your SQL browser is running and you have enabled TCP/IP for SQL server protocols and set them to listen to all.. you should be fine, without port number.

  • Do you have a firewall between the servers?

    Maybe allow the ports on them.

  • Like stated in my case above, SQL Browser service is started, and there are inbound rules in the firewall for the ports

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply