I want to set up a tool using osql (the command line version of sql server's tsql) to run queries. Here is my command:
"c:\Program Files\Microsoft SQL Server\80\Tools\Binn\osql.exe" -E -S servername -d dbname -Q "%sel" -w 1000
Of course, "servername" and "dbname" are replaced appropriately.
If I run this command in a DOS window (I'm running Win2k) and replace "%sel" with my sql query (which is simply "select count(*) from tableinfo"), it runs fine and I get back the result, which is the number 16 (there are 16 records).
However, I haven't been able to get the result to appear in UE's output window. At most, when I highlight the query and run the tool, I get a messagebox that says "Operation completed successfully". That's fine, but I really want to see the result. Also, it wants to save the query in a text file, which I don't need. I just want to see the result.
I have tried various combinations of option settings, with no luck (although with some settings it does put the command in the output window!) then I thought I'd see if someone in the forums can help me.
Just for the record, besides the command as above, my tool settings are:
Options - DOS Program; save active file; save all files first
Output - Append to existing;Capture output;No replace
"c:\Program Files\Microsoft SQL Server\80\Tools\Binn\osql.exe" -E -S servername -d dbname -Q "%sel" -w 1000
Of course, "servername" and "dbname" are replaced appropriately.
If I run this command in a DOS window (I'm running Win2k) and replace "%sel" with my sql query (which is simply "select count(*) from tableinfo"), it runs fine and I get back the result, which is the number 16 (there are 16 records).
However, I haven't been able to get the result to appear in UE's output window. At most, when I highlight the query and run the tool, I get a messagebox that says "Operation completed successfully". That's fine, but I really want to see the result. Also, it wants to save the query in a text file, which I don't need. I just want to see the result.
I have tried various combinations of option settings, with no luck (although with some settings it does put the command in the output window!) then I thought I'd see if someone in the forums can help me.
Just for the record, besides the command as above, my tool settings are:
Options - DOS Program; save active file; save all files first
Output - Append to existing;Capture output;No replace