Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2004
    Posts
    5

    Unanswered: osql -b question!

    the help document said that

    "osql -b will specifies that OSQL exits and returns a DOS ERRORLEVEL value when an error occurs. The value returned to the DOS ERRORLEVEL variable is 1 when the SQL Server error message has a severity of 10 or greater; otherwise, the value returned is 0."

    my question is : how can I get the DOS ERRORLEVEL.

    example:

    C:\>isql -E -b -Q"backup log pubs to disk='C:\adsfasd.tmp'"

    the result:

    Msg 4208, Level 16, State 0, Server YANG, Line 1
    当恢复模型为 SIMPLE 时,不允许使用 BACKUP LOG 语句。请使用 BACKUP DATABASE 或用
    ALTER DATABASE
    更改恢复模型。
    Msg 3013, Level 16, State 1, Server YANG, Line 1
    BACKUP LOG 操作异常终止。

    It's in chinese language,means
    "can not use BACKUP LOG when the restore model being SIMPLE,you can use ALTER DATABASE or BACKUP DATABASE to change the restore model.
    Msg 3013, Level 16, State 1, Server YANG, Line 1
    BACKUP LOG aborted"

    where is DOS ERRORLEVEL???? How can I get it????

    thanks

  2. #2
    Join Date
    Nov 2002
    Posts
    833
    take a look at the server errorlog or the backupserver errorlog for details

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    See KB#39585.

    -PatP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •