Skip to content

Pixeldyne/sqlservertestconnect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

About

Simple Microsoft SQL Server connection tester, a command line program written in C# for .NET 4.6 or newer. Uses the System.Data.SqlClient to connect to a server and database specified in the app.config file and retrieves a list of databases. If a connection cannot be made or another error occurs, exceptions are written to the console.

Configuration

Edit the test connection string in app.config, for example:

<add name="test" connectionString="Data Source=localhost,1433;Initial Catalog=test;Integrated Security=False;User ID=testuser;Password=;Connect Timeout=30"/>

Running the test

Open the terminal (command line) window and run SqlServerTestConnect.exe

If you do not see the text Connection successful..., examine any exceptions printed and check the connection string.

Troubleshooting

Query

The following query is hard-coded to prevent abuse (but not meant to deter determined attackers)

SELECT name FROM sys.databases

This query will work for any user with db_datareader permission on the configured database.

Author

This tool was written by Mac Plewa.

About

SQL Server connection tester

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages