Forum Replies Created

Viewing 2 posts - 1 through 3 (of 3 total)

  • RE: Passing value from stored procedure to DOS script

    use select query in the exit block, then the value would be avalaible for

    %errolevel% variable

    osql -E -SMSHSRMNSUKD0311 -Q "EXIT(Declare @asd smallint Exec test_db..usp_jobs_status @OutVal=@asd OUTPUT select @asd)

    echo %ERRORLEVEL%

    Or insted modify...

  • RE: Passing value from stored procedure to DOS script

    You can try using EXIT in the SQL file

    EXIT(set nocount on

    DECLARE @ReturnCode INT

    Exec YourStoreProc @retstatus=@ReturnCode output

    select ISNULL(@ReturnCode,7))

    In the cmd / bat file after the osql

    use %ERRORLEVEL% variable to get the...

Viewing 2 posts - 1 through 3 (of 3 total)