I use a RAISEERROR for a critical error in a CATCH. When the Job is run, it does fail but it gives the following message. How do i get my @Note to show in the Log File Viewer? Also, where is the log referenced 'WITH LOG'. I looked at the SQL Server Agent Log and did not see anything.
Message
Executed as user: NT AUTHORITY\SYSTEM. TCP Provider: The specified network name is no longer available. [SQLSTATE 08S01] (Error 64) Communication link failure [SQLSTATE 08S01] (Error 64). The step failed.
DECLARE @Note VARCHAR(500) = 'RAISEERROR due to Critical error' RAISERROR (@Note, 20, 127) WITH LOG