Viewing 2 posts - 1 through 2 (of 2 total)
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
September 1, 2005 at 11:53 am
#586970
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...
September 1, 2005 at 4:03 am
#586764