Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

Invoke-Sqlcmd : A network-related or instance-specific error occurred while esta

$
0
0

Via a Runbook, I am trying to drop a non-prod database (in Resource Group A) and re-create the database from prod database (in Resource Group B).

CREATE DATABASE non-prodAS COPY OF prodserver.prod

As a TEST, I am tring to run a sql query as below Using "Run As Account"

Invoke-Sqlcmd -Query "SELECT COUNT(*) AS Count FROM abc.XYZ" -ConnectionString "Data Source= alpha.database.windows.net ;Initial Catalog=beta;Integrated Security=True;ApplicationIntent=ReadOnly"
Getting Error
Invoke-Sqlcmd : 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>