Wednesday, March 7, 2012

OSQL fails silently

Hello,
I have a InstallShield program that installs MSDE and then creates a new
database in it. To set up the new database on MSDE I run OSQL. Most of the
time, OSQL works OK. But, sometimes it fails and doesn't print out any
error messages (in the output file).
Has anyone seen this intermittant silent failure behavior before?
The OSQL command I use is:
OSQL.EXE -E -b -i SetupRTEDatabase.sql -o SetupRTEDatabase.log
Regards,
RobertHi Robert
You don't say if you check ERRORLEVEL after the call?
How large the input file?
Have you tried the -e parameter to see the commands?
John
"Robert Wheadon" wrote:

> Hello,
> I have a InstallShield program that installs MSDE and then creates a new
> database in it. To set up the new database on MSDE I run OSQL. Most of t
he
> time, OSQL works OK. But, sometimes it fails and doesn't print out any
> error messages (in the output file).
> Has anyone seen this intermittant silent failure behavior before?
> The OSQL command I use is:
> OSQL.EXE -E -b -i SetupRTEDatabase.sql -o SetupRTEDatabase.log
> Regards,
> Robert
>
>|||Hello John,

> You don't say if you check ERRORLEVEL after the call?
>
Yes, I do. When OSQL decides to fail, I get an ERRORLEVEL of 1.

> How large the input file?
>
10 KB

> Have you tried the -e parameter to see the commands?
>
No. I hadn't thought of that.|||Hi
Non zero values of ERRORLEVEL indicate and error. Have you checked the
output for Msg?
OSQL can have issues with larger files, you may want to split your script
into multiple files and run them separately.
You may also want to specify -n to get cleaner output.
John
"Robert Wheadon" wrote:

> Hello John,
>
> Yes, I do. When OSQL decides to fail, I get an ERRORLEVEL of 1.
>
> 10 KB
>
> No. I hadn't thought of that.
>
>|||I've sorted this one out. See my post "OSQL returns error code of 1 -
intermittently.
SysInternals' FileMonitor and ProcessMonitor tools were helpful in finding
the problem.
"Robert Wheadon" <robert.wheadon@.monitorbm.co.nz> wrote in message
news:eslJ5B3UGHA.4772@.TK2MSFTNGP14.phx.gbl...
> Hello John,
>
> Yes, I do. When OSQL decides to fail, I get an ERRORLEVEL of 1.
>
> 10 KB
>
> No. I hadn't thought of that.
>

No comments:

Post a Comment