The server was not found or was not accessible
As the error message says.
Can you connect to the SQL Server using SSMS with same server name and credentials?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
What are the options available to get SQL server versions(CU) install in SQL Server VM. THis is needed to maintain the wiki package for multiple vm across the multiple environment, I have tried
$serverName = "YourSqlServerName"
$databaseName = "master"
$query = "SELECT SERVERPROPERTY('ProductVersion') AS 'ProductVersion', SERVERPROPERTY('ProductLevel') AS 'ProductLevel'"
$username = "YourUsername"
$password = "YourPassword"
Invoke-Sqlcmd -ServerInstance $serverName -Database $databaseName -Query $query -Username $username -Password $password
but resulted in " A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server)".
Thanks
Fazil Ummer
The server was not found or was not accessible
As the error message says.
Can you connect to the SQL Server using SSMS with same server name and credentials?
Hi Ummer, Fazil •,
Thanks for the reply.
Since from Azure Portal Cloudshell you are trying and Network configuration is correct, please double-check the credentials used and you have needed permissions.
If all above works fine and still you are facing issue, I would request you to raise support case so that a dedicated engineer can deeply investigate the issue.
Let us know if you need help in raising the same. Thanks.