Is there some easy cmd commands I can use to check if I can connect to my SQL Database Server? (windows computers).
-
3Powershell, wsscript, ping server to see if it's reachable, use odbc administrator add a connection and see if it connects... all methods which could check to see if server is reachable. – xQbert Jun 01 '17 at 14:19
-
Well I would like to avoid installing any software that I can - Beacuse I won´t use these computers with the database later - so I would have to uninstall everything once I have checked it is working – Lealo Jun 01 '17 at 14:25
-
2all of the above are installed by default on windows computers (assuming supported versions) Powershell example: https://stackoverflow.com/questions/25682703/connect-to-sql-server-database-from-powershell wscript https://stackoverflow.com/questions/1366516/connect-to-mysql-5-0-database-using-pure-vbscript ODBC driver for sql server should be there by default as well... – xQbert Jun 01 '17 at 14:26
3 Answers
Open your Notepad and save your file as .udl This is a Microsoft Data Link file extension. Double clik and enter your connection string. Click "Test Connection"
- 31
- 1
-
-
You create a new file on your desktop and save it as TestConnection.udl for example. Close your editor and double click on the file to fill the properties. Click "Test Connection". – user8098337 Jun 01 '17 at 15:07
-
1
Posted this here originally: https://dba.stackexchange.com/questions/23704/easy-way-to-check-connectivity-to-sql-server-from-client/306016#306016
There are so many ways to check connectivity - I got tired of googling every time I needed to check SQL connectivity from Windows, macOS, linux; to help with that, I created a docker image to test SQL connectivity. It's very (very) basic and I will probably improve this overtime, but hopefully it saves people time. Ok, so to test SQL connectivity simply run this command:
docker run -it ssaadi/test-sql-conn
It will ask you for host name, instance, port etc and then will try to connect and run select @@servername or display error if it fails.
The script is created in python and uses pymssql for sql connection -- the very very basic source code can be found here: https://github.com/sameersaadi/test-sql-conn
- 163
- 2
- 6