Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 run script in cmd (help?)

Author  Topic 

morphias0
Starting Member

20 Posts

Posted - 2006-03-22 : 10:30:31
We run the backup scripts we have with a command similar to
osql -E -n -i [script source] -o [log destination]
at the cmd prompt. After it completes there is no sign of it in the command prompt and you have to go look at the log file. This is fine for me but my boss wants it to actually display something in the cmd window. Is there a way to display whether it completed with errors or not in the same command window that the script is being run from.

Any help is appriciated,
Thanks in advance
Todd

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-03-22 : 12:21:48
After the OSQL command, add:
type [log destination]

where [log destination] is the same output file that the OSQL command used.


CODO ERGO SUM
Go to Top of Page

morphias0
Starting Member

20 Posts

Posted - 2006-03-22 : 13:15:23
They would like to see whether it failed or if it completed successfully. They dont really want to look at the whole log. I was thinking that I could have it return a 0 if no errors and a 1 if there were one or more errors while running the script.

Is that possible?

Go to Top of Page
   

- Advertisement -