Friday, February 24, 2012

How to know the code in Query Analyser

My Program wants to know what is being edited in Query Analyser currently.
How can I do that?

Thanks.

I would not consider it nice for an application to snoop inside of another unless there is a system to addin that functionality.

Why do you want to know what is beeing edited?

One approach if you want to get the edited text is to use the Process class to launch query analyzer editing a temporary file. You will then add a FileSystemWatcher class to check whenever the user is saving the changes to the temporaryfile. You can then pick up any changes and in that way get what is in query analyzer. But only when the user chooses to save.

When the process closes you can remove the watching of the file and the file.

|||

Thank you 4 your answer,

I just want My program to prompt the SQL,tables and so on in MS Query Analyser when the user press the Space Key or Dot Key(".") in the SQL editor.

What is your opinion?

|||

You will have to do it in your own query tool. You can have a look at Query Commander and its source code, it is a query tool with intellisense. It is written in C#.

|||

Thank you 4 your suggestion,

There is an interesting tool called promptsql, http://www.promptsql.com/

how does it work? do you have any idea?

|||

I would not consider it nice for an application to snoop inside of another unless there is a system to addin that functionality.

For query analyzer I am not familiar with any addin functionality so I would suspect that promptsql installs hooks and finds out if the active window belongs to certain application like query analyzer when certain keyboard sequences has been entered.

No comments:

Post a Comment