Visual Studio external tool configuration
The most simple way to use csql in Visual Studio is to configure it as an external tool.
Using the steps described here you can manage the command parameters in a file located in your solution
root directory. Scripts are executed by choosing the configured tools menue item. All output
and error messages will go into an output pane of the IDE.
Click the Menu ItemTools → External Tools…
In a default Visual Studio installation the following dialog appears:
In the external tools dialog press the Add Button.
Enter a title for the tool. In the Command field enter the path of csql.exe. In this sample we
want to use a argument file that is expected in the current solution directory. So, in the Arguments field
we enter the option -cf $(SolutionDir)csqlargs.txt. Because the command should always execute the
script currently open in the editor we add the option -i $(ItemPath).
In the field Initial Directory enter the text $(ItemDir). This will allow us to use relative
paths in the script #include directives.
To get the output into a pane of Visual Studio also enable the check box option Use Output Window..
After entering all data the dialog should look like the following screen shot: