Hi folks:
I want to run a sql script(Sql server 7.0) from the Textpad and also pipe the output
to a new file within Textpad. Can somebody advise me on the exact steps I should
follow to achieve this.
I have MS-SQL SERVER 7.0 on my own PC.
Thanks in advance for your help.
Regards.
Murali.
running sql script from text pad
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Re: running sql script from text pad
Hi, this sounds just like the problem that my friend has overcome. It is quite similar to what they wanted to do. You either have to code your own mini program that does it in c++ or JAVA etc and then call it within texpad as a customised tool. The parameters can be passed by optional user input in that program or passed to the program as parameters. The output can then be displayed on the screen or in a file that like you said can be automatically opened in text pad. Personally i think a small VB proggy could do this with ADO as i have done VB progs running on the same Svr Version. Anyway, hope that helps.
C-,,
C-,,
Re: running sql script from text pad
go to Configure->Preferences.
In the Preferences window that appears, click on "Tools" in the tree view on the left.
click on the "Add" button on the right. Choose DOS Command.
type in something appropriate for your server that is like below. (this is the isql command line utility, it is books-online also, or type isql /? at the command prompt)
isql -Usa -P"password" -d DATABASENAME -S SERVERNAME -w1000 -n -i $file
sa = whatever your username is
password = password
and so on...
if you using trusted connection, then not -P is used, something else I think.
the results will go to the "command" window in textpad, if the "capture output" box is checked in the Preferences window.
As far as a new file goes, maybe record a macro to copy and paste all the stuff from the command window? I am not sure about that part.
I hope that helps.
(That is the main reason I got textpad actually, way better than isqlw thing with sql7.)
In the Preferences window that appears, click on "Tools" in the tree view on the left.
click on the "Add" button on the right. Choose DOS Command.
type in something appropriate for your server that is like below. (this is the isql command line utility, it is books-online also, or type isql /? at the command prompt)
isql -Usa -P"password" -d DATABASENAME -S SERVERNAME -w1000 -n -i $file
sa = whatever your username is
password = password
and so on...
if you using trusted connection, then not -P is used, something else I think.
the results will go to the "command" window in textpad, if the "capture output" box is checked in the Preferences window.
As far as a new file goes, maybe record a macro to copy and paste all the stuff from the command window? I am not sure about that part.
I hope that helps.
(That is the main reason I got textpad actually, way better than isqlw thing with sql7.)