Share via

How to connect and querying SQL Server dB from another VM

ShaqAX 1 Reputation point
2021-08-15T11:04:58.897+00:00

Hello,

Would to ask your guidance, but to be honest I don't have any experience on SQL Server Administration, so probably need a clear "To do steps" over here.

So currently I have two VM that both have its SQL Server DB installed. The question is : if I want to query the other DB from my VM by using SSMS how am I going to achieve that ?

For example, I have VM A and VM B, VM A is my development VM, but if I need to query something I want to query DB in VM B.

Currently, using SSMS, when I try to Connect and put the Server name of VM B then using SQL Server Authentication and use VM B user (admin) and its password, it will say error "Network path not found"

What are the steps to connect and querying DB on another VM ?

SQL Server on Azure Virtual Machines
0 comments No comments

1 answer

Sort by: Most helpful
  1. Ronen Ariely 15,221 Reputation points
    2021-08-15T11:12:56.79+00:00

    Good day ,

    Please check Microsoft step by step tutorial

    Quickstart: Connect and query a SQL Server instance on an Azure virtual machine using SQL Server Management Studio (SSMS)

    Basically it is like any remote connection to SQL Server,

    Prerequisites

    (1) you need to open the firewalls to port 1433 in the remote machine Azure network (The machine which include the SQL Server) + Open the Machine firewall

    Check this Docs regarding security

    (2) Make sure that the remote machine has static IP if you want to use the IP or configure DNS to the remote machine

    (3) If you want to connect using user and password instead of windows authentication then configure the SQL Server to use Windows authentication or mixed Mode (SQL Server authentication and Windows authentication)

    Connect

    Same as connecting any SQL Server on remote machine (use the IP or the DNS of the remote machine for the Server Name)

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.