home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 19,400 of 19,505   
   Anton Shepelev to All   
   `sqlcmd' withholding error messages?   
   11 Aug 22 13:10:35   
   
   From: anton.txt@g{oogle}mail.com   
      
   Greetings to master Erland and all good people prefer-   
   ring the cleanliness and freedom of  Usenet  to  clut-   
   tered  and centralised web-based media. On a dedicated   
   machine I host many SQL Server instances  and  perform   
   some  regular  maintenance operations via `sqlcmd' in-   
   voked in a batch script in a loop over a file  with  a   
   list  of instances. The relevant fragment is shown be-   
   low:   
      
   for /F %%f in (instances.txt) do (   
      sqlcmd -A -r 0 -b -l 4 -t 120 -S SBOSQL%f -i %SCR_PAT%%s 2> error.txt   
      IF ERRORLEVEL 1 (   
         echo %DATE% %TIME%:                      >> errors.txt   
         echo Error invoking %SCR_PAT%%s for %%f: >> errors.txt   
         type error.txt                           >> errors.txt   
         echo --                                  >> errors.txt   
      )   
      del error.txt   
   )   
      
   Most of the time is works as expected, but on rare oc-   
   casion the log file will contain error entries with an   
   empty message, e.g.:   
      
      Thu 08/11/2022 13:04:12.46:   
      Error invoking mem_bal _mem_balance.sql for SBO35:   
      --   
      
   Which means that `sqlcmd' returned an error  code  yet   
   did not print any message to standard output. Do I in-   
   voke it incorrectly?   
      
   --   
   ()  ascii ribbon campaign - against html e-mail   
   /\  http://preview.tinyurl.com/qcy6mjc [archived]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca