My own version of old MSSQL query analyzer

  • From: "Jacob Kruger" <jacobk@xxxxxxxxxxxxxx>
  • To: <ProgrammingBlind@xxxxxxxxxxxxx>
  • Date: Tue, 5 Apr 2011 17:01:34 +0200

This was partly since couldn't really find a version of 
SQLServerManagementStudioExpress to work on all my machines, and also partly 
since I used to use the old faithful Query Analyzer for various things in any 
case.

If you want to check it out - and if it will work on your side without an 
actual installer:
http://dl.dropbox.com/u/13327195/DBAdmin.zip

The app.config file has an XML entry for the name of the ODBC datasource that 
it wants to point to your server's master database, using windows 
authentication, and the one I was using here was just called masterDB, and 
aside from that, currently, it will hide master and model, and let you select 
from the other databases on the server, then there's a text area to put your 
T-SQL in, a button to make it try execute it, where it will do 2 things - one 
is to render any returning data into a sort of dynamically changed webpage, 
which actually gets saved in the output subfolder, and if you made changes to 
data, with something like a nonQuery bit of scripting, it should tell you how 
many records were affected.

Aside from that, there are 2 other drop down boxes, where you get to select 
from a list of current tables in the currently selected database, and another 
one for stored procedures, and the things listed herein are controlled by 
object name prefixes - since I would standardly use tblName and spName for 
naming these two types of things, and if you click on the listing options 
button, it will prompt you for your prefixes - might still make it possible to 
use no prefix, but then it would want to list all system tables, etc.

After that, there's a refresh button, in case you made changes to prefixes, or 
thing the listings aren't right after choosing a different database - although 
that should happen automatically, and the last two buttons allow you to view a 
limited version of the structure of a table - asn in field/column names, data 
types, and length (in bytes for some data types), in a dynamically rendered 
webpage, or to have the creating script of a stored procedure copied to 
clipboard in case you want to copy it into the editing box to either use it for 
reference, or to make use of it for whatever, or even just  review it - and 
that will just beep when copied.

All in all, haven't bothered too much with actual interface, apart from 
(hopefully) making sure the components don't overlap etc., and making sure all 
of them make use of shortcut keys, etc., and if the script you tell it to 
execute causes an error, you will be given the full content of the error 
message FWIW.

Stay well

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

Other related posts:

  • » My own version of old MSSQL query analyzer - Jacob Kruger