SQL Server DB Queries - App Crashes and More Usage Information

As we just posted on Twitter, there's a new version of SQL Server DB Queries that should appear on the Microsoft Store shortly. It turns out our code wasn't handling an exception that could occur while it was backing up the SQLServerDBQueries.xml file, which it always does before saving the current set of queries. This unhandled exception would result in an app crash.

App Help


Since SQL Server DB Queries doesn't include in-app help, I want to provide some info here.

Where's the XML file?


First of all, the application stores its XML file in the user's Documents folder, in a sub-folder named "SQLServerDBQueriesItems". You'll normally see two files in this folder:

SQLServerDBQueryItems.xml
SQLServerDBQueryItems.xml.bak

When you close the application, if there's an existing SQLServerDBQueryItems.xml file, it's copied and the .bak extension is added. Then the current items are saved to the SQLServerDBQueryItems.xml file.

The SQL Server DB Queries User Interface

SQL Server DB Queries

The Queries field is both a drop-down list of all the saved queries, and an entry field. You can name and save queries, or rename an existing query and save it to the new name.

The Query field is where you type or paste in your query. This should be any valid T-SQL query that performs selects, updates, etc.

The Execute Query button does just that. It attempts to run the query in the Query field against the specified SQL Server instance. You can also press F5 to execute the query.

New Query clears the Queries and Query fields so you can create a new query.

Save Query saves either the new query or any changes made to an existing query. It can also save changes you'd made when you rename a query.

Copy Query makes a copy of the current query, adding "Copy of" to the beginning of the name.

Delete Query deletes the current query.

Settings... displays copyright, support, and licensing information, as well as the SQL Server connections strings. It's recommended you use Windows authentication, though, since we store the SQL Server Password in plain text in the user's settings file.

The last option in SQL Server DB Queries Settings is the check box, "Execute query when selected from Queries drop list (only recommended for SELECT queries)". It's recommended you leave this unchecked unless you only use the application to perform select queries. Otherwise you can update or delete data from the database, which may not be what you were intending to do.

Important Note


SQL Server DB Queries doesn't warn you when you are going to lose unsaved changes. If you edit a query or rename one, for example, then click New Query or close the application, it won't warn you and you'll lose those changes.

In Closing

We hope the new version of SQL Server DB Queries that should be rolling out shortly resolves any issues you've had with crashes. And we hope the information presented here proves helpful in using the application. If you have any questions, please e-mail us at support@maxleafsoft.com or send us a message on Twitter (https://twitter.com/MLeafsoft).

Regards,
Gary Lucero
MaxLeafSoft

Comments