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.
| Author |
Topic |
|
ulustig
Starting Member
1 Post |
Posted - 2005-03-06 : 07:28:01
|
| Hi,I am using OSQL in a batch file to create a database/user/tables and need a way to fint out if there was an error or not, how can I do that ? |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-03-06 : 08:16:18
|
| You can redirect the output to a file using the -o switch. (-n suppresses the numbers that osql generates in the output.)ie:osql -S myServer -U myLogin -P myPassword -d myDatabase -i c:\osqltest.sql -o c:\osqltest.txt -nBe One with the OptimizerTG |
 |
|
|
TimS
Posting Yak Master
198 Posts |
Posted - 2005-03-07 : 14:01:35
|
| osql.exe blah blahIF errorlevel 1 goto errorSEE EXIT() function also.Tim S |
 |
|
|
|
|
|