Posts Tagged ‘Excel’

Tool to query SQL databases

Friday, January 15th, 2010

For some tasks it is useful to run a custom query against a database.
The application using the database perhaps does not have the ability to generate certain reports.
Using SQL manager is a viable option, but then everyone who needs to have this installed to be able to run a query.
It is however possible to create some Excel-files which have the queries embedded.

But as an alternative solution I have created this PowerShell app.
It is a GUI-based tool allowing you to select a saved script or enter a custom query and run it.
The output is by default displayed in a datatable but the output can also be exported to an Excel-document.

The available SQL servers are defined in servers.xml
And to avoid the hassle of selecting a server and database after selecting a script you can predefine a combination of a shortname, server and database in shortnames.xml
Eg. if you have a SQL-file hlp_openincidents.sql and hlp is defined in shortnames.xml with server set to SQLSERVER and database to HELPDESK the tool will autoselect the server: SQLSERVER and the database: HELPDESK

SQL_tool.zip (9891 downloads )