I have been facing this type of situation a dozen of times now and final want a permanent solution to it.
Cannot find Server PC's SQL Instance name on client PC.
Note:- I have installed SQL Express And Management Studio on both server and client
Server PC Name : M-PC
Server SQL Version : SQL Server 2008
Client PC Name : SHIVANG
Client SQL Version : SQL Server 2008
Client's PC SQL Server Screenshot
1) Switching OFF firewall of both server and client PC completely (Domain, Private & Public)
2) Enabling and restarting the services : SQL Server and Browser Service
3) Enabling SQL Network Configuration settings
4) Also enabled "Allow remote connection" from SQL Server of both the PC
5) Networking between both the PC is perfect can access files through network of both the PC.
6) Even changed the IP configuration settings from obtain to static of both the PC (IP of Server is 192.168.1.41 and IP of client is 192.168.1.44)
7) I have completely uninstalled SQL Express and Management Studio from client and server and installed it again.
8) I also told my client to format the PC and then installed SQL Express and Management Studio. Still nothing.
9) They don't have any antivirus on any of the system (to block the connection)
Now the fun part here is while i was fiddling with the settings of client and server PC. Server PC started showing the client PC SQL Instance while client PC was still unable to find the server SQL Instance.
Below image is of Server PC's SQL Server
Below image is of Client PC's SQL Server
Here are the following settings i have been fiddling with:-
Now i don't have a clue what to do next to solve this problem. Please help me if you can.
Thanks in advance
Get-ChildItem cmdlet To list all the SQL instances, navigate to the root directory and run the Get-Childitem to get the list. Note: The path SQLSERVER:\SQL\<ServerName> has all the installed SQL instances of the listed server.
To connect to a named instance, the SQL Server Browser service must be running. In SQL Server Configuration Manager, locate the SQL Server Browser service and verify that it's running. If it's not running, start the service. The SQL Server Browser service isn't required for default instances.
Make sure your server name is correct, e.g., no typo on the name. When you try to connect to an SQL Server instance on another server, make sure the server machine is reachable, e.g, DNS can be resolve correctly, you are able to ping the server (not always true). Make sure SQL Browser service is running on the server.
There are two levels of security that need to be changed in order to allow remote access.
There are two cases depending on the type of SQL Server instance you're connecting to:
Named instance (connect by computer name + instance name). Add an allow incoming rule on UDP port 1434 to access to the SQL Browser service. Add an allow incoming rule on the database engine service.
Reference Stack
A Youtube Tutorial
I don't have a definitive answer for your inconsistent results but I do have some background information that may help you troubleshoot the problem.
SQL instances are enumerated using the SQL Server Resolution Protocol. This is an application layer protocol that uses UDP (not TCP) to send enumeration requests to servers on the local subnet and receive responses as shown in the communication flow for multi-instance discovery diagram. It is the SQL Server Browser services that listens on UDP port 1434 to handle enumeration requests.
Importantly, the UDP multicast protocol does not guarantee requests or responses are delivered. Consequently, loss may occur that can only be detected by a network trace. The SQL Server Resolution Protocol cannot know why no response was received; it could be because a server is down, network problem, firewall, SQL instance hidden, etc. Also UDP multicast requests are delivered only to devices on the local subnet so resolution is limited to those machines.
The PowerShell script below sends a UDP request to a specific host. You can run this to ensure the SQL Browser service responds with the expected information about the instance(s) on the host.
Function List-Instances($hostName)
{
Write-Host ("Retrieving information from SQL Server Browser service on host $HostName ...");
try
{
$udpClient = new-object Net.Sockets.UdpClient($HostName, 1434);
$bufferLength = 1;
$browserQueryMessage = new-object byte[] $bufferLength;
$browserQueryMessage[0] = 2; # list all instances
$bytesSent = $udpClient.Send($browserQueryMessage, $browserQueryMessage.Length);
$udpClient.Client.ReceiveTimeout = 10000;
$remoteEndPoint = new-object System.Net.IPEndPoint([System.Net.IPAddress]::Broadcast, 0);
$browserResponse = $udpClient.Receive([ref]$remoteEndPoint);
$payloadLength = $browserResponse.Length - 3;
$browserResponseString = [System.Text.ASCIIEncoding]::ASCII.GetString($browserResponse, 3, $payloadLength);
$browserResponseString
$elements = $browserResponseString.Split(";");
$elements
$namedInstancePort = "";
Write-host "SQL Browser Data:" -ForegroundColor Green;
$i = 0;
while($i -lt $elements.Length)
{
if([String]::IsNullOrEmpty($elements[$i]))
{
Write-Host "";
$i += 1;
}
else
{
Write-Host $(" " + $elements[$i] + "=" + $elements[$i+1]) -ForegroundColor Green;
$i += 2;
}
}
}
catch [Exception]
{
Write-host $("ERROR: " + $_.Exception.Message) -ForegroundColor Red;
}
}
# send request to SQL Brower service to enumerate all SQL instances running on specific host
List-Instances -hostName "SomeMachine";
In summary, successful resolution requires:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With