- Docs
- /
06 Jun 2022 19119 views 0 minutes to read Contributors
This solution tries to connect to SQL Server.
Sometimes a simple telnet 1433 does not give you the 100% guarantee a connection to SQL Server will actually be possible. If you do not have a SQL Server management studio tool available then this one can help you out.
Making a real connection to SQL Server gives you the guarantee that you can connect.
Download SQLConnection here. The tool doesn't do anything else than make a connection. It does not perform any query.
The solution is a console application and needs no setup. You can start the application from the commandline and it starts asking for details.
servername |
You can enter any value here. A FQDN, DNS name, IP address, comma separated Portnumber. E.g.: sqlserver-1 sqlserver-1.mydomain.com 10.1.1.10 sqlserver-1,1433 10.1.1.10,1433 |
Windows authentication y/n |
Y - if you want to connect with your currently logged in Windows name N - if you want to provide SQL Server user / password combination |
SQL Loginname |
sql server login |
Password |
password |
It will try to make a connection to the specified SQL Server, either with Windows authentication or SQL authentication.
Download Visual Studio C# solution
T-SQLTransact-SQL
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Test_SQL_Connection{class Program{static void Main(string[] args){string serverName;string userId="";string password="";bool integratedSecurity;Console.WriteLine("SQLTreeo (c) 2019 - SQL Server Connectivity test v1.0\n");Console.Write("Enter SQL Server name (servername/ip-address)[,portnumber]: ");serverName = Console.ReadLine();Console.Write("Integrated security (Y/N): ");if (Console.ReadLine().ToUpper() == "Y"){integratedSecurity = true;}else{integratedSecurity = false;}if (!integratedSecurity){Console.Write("Enter SQL Loginname : ");userId= Console.ReadLine();Console.Write("Enter Password: ");password = Console.ReadLine();}var connectionString = integratedSecurity ? string.Format("Data Source={0};Integrated Security=SSPI;Connection Timeout=5", serverName): string.Format("Data Source={0};User ID={1};Password={2};Connection Timeout=5", serverName, userId, password);var connection = new System.Data.SqlClient.SqlConnection(connectionString);try{using (connection){connection.Open();Console.WriteLine("Connection to SQL Server successful.Press a key to quit.");}}catch (Exception exception){Console.WriteLine(exception.Message);Console.WriteLine("Failed to connect to SQL Server. Press a key to quit.");}finally{connection.Close();Console.ReadKey();}}}}
In this article
Please choose a monitoring environment to connect to:
Enter your email address to recover your password.
Download link successfully sent. Check your email for details.
Reset password link successfully sent to . Check your email for details.
An email with a link for creating your password is sent to
Share link successfully sent to .
Your reply is send.
Download link successfully sent to . Check your email for details.
Download link successfully sent to . Check your email for details.
Download link successfully sent to . Check your email for details.
Download link successfully sent to . Check your email for details.
We received your request. We will contact you shortly