I know, the title is not good enough, but... Anyway, here's what I want to do:
1. I have an add-in exposed as menus under the tool menu.
2. Eventually I'll have a *.sql file with some sql statements (however this file will not be in a database project).
3. I would like to be able to "Run" a statement from the *.sql file as I can do against a query file from inside a database project.
Is this possible, if so how
Niels

Run SQL statements from .sql file
Ilkin
I have a similar requirement.
I have created a custom tool window. When the user double clicks on a node in that tool window, the user gets to see the SQL Statement associated with that node in an editor. I want to provide the user the ability to right click on the node and run the SQL statement. This is similar to the functionality one gets in the Solution Explorer window of a DBP project. How can I provide this functionality in my custom window Can my custom tool window invoke the same APIs that the Solution Explorer tool window calls in a DBP project
Thanks,
Vijay
MickRivers
This is certainly possible. You can see how to create an add-in with exposed menu items by using the new addin wizard from the New Project dialog. There's an option in the wizard to create a menu item in Tools that will demonstrate how to add such a command.
As for step #2, I'm not sure what you mean by this but it is possible to access the file from DTE.ActiveDocument.
For step #3, the Exec for the tools menu allows you to run any code you wish but I'd need more detail to help.
Thanks,
Sean