question

ShaqAX-4661 avatar image
0 Votes"
ShaqAX-4661 asked pituach edited

How to connect and querying SQL Server dB from another VM

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 ?

azure-sql-virtual-machines
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

pituach avatar image
1 Vote"
pituach answered pituach edited

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)


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.